From ec94b026c1bd09ddcbf5178cab3e3733eb9a898d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 9 Aug 2013 18:09:35 -0700 Subject: ceph-disk: do not mount -o '' Let's not trust all distros to be polite about this. Signed-off-by: Sage Weil --- src/ceph-disk | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/ceph-disk b/src/ceph-disk index 0ecfdf02073..23d4e17de54 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -668,15 +668,11 @@ def mount( ) try: LOG.debug('Mounting %s on %s with options %s', dev, path, options) - subprocess.check_call( - args=[ - 'mount', - '-o', options, - '--', - dev, - path, - ], - ) + args = ['mount'] + if options: + args.extend(['-o', options]) + args.extend(['--', dev, path]) + subprocess.check_call(args=args) except subprocess.CalledProcessError as e: try: os.rmdir(path) @@ -1366,16 +1362,11 @@ def move_mount( # /etc/mtab, which *still* isn't a symlink to /proc/mounts despite # this being 2013. Instead, mount the original device at the final # location. - subprocess.check_call( - args=[ - '/bin/mount', - '-o', - mount_options, - '--', - dev, - osd_data, - ], - ) + args = ['/bin/mount'] + if mount_options: + args.extend(['-o', mount_options]) + args.extend(['--', dev, osd_data]) + subprocess.check_call(args=args) subprocess.check_call( args=[ '/bin/umount', -- cgit v1.2.1