]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: fix except to catch OSError
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 20 Mar 2013 12:27:27 +0000 (13:27 +0100)
committerSage Weil <sage@inktank.com>
Fri, 26 Apr 2013 20:40:05 +0000 (13:40 -0700)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 9daf6cfce2d57509d896eae28bb97146a682a306)

src/ceph-disk

index abba6f53a92faf01dc6b1a1136117c1ab8ee541d..9081ca93b47e1df60b2a0704af3eade4dc30215a 100755 (executable)
@@ -786,7 +786,7 @@ def prepare_dir(
     else:
         try:
             os.unlink(os.path.join(path, 'journal_dmcrypt'))
-        except:
+        except OSError:
             pass
 
     write_one_line(path, 'ceph_fsid', cluster_uuid)
@@ -1273,7 +1273,7 @@ def mount_activate(
                 parent_dev = os.stat('/var/lib/ceph/osd').st_dev
                 if dst_dev != parent_dev:
                     other = True
-        except:
+        except OSError:
             pass
         if active:
             log.info('%s osd.%s already mounted in position; unmounting ours.' % (cluster, osd_id))
@@ -1429,7 +1429,7 @@ def activate(
                 if other != init:
                     try:
                         os.unlink(os.path.join(path, other))
-                    except:
+                    except OSError:
                         pass
 
         if not os.path.exists(os.path.join(path, 'active')):