]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: print subprocess.CalledProcessError on error
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 25 Mar 2013 13:36:41 +0000 (14:36 +0100)
committerSage Weil <sage@inktank.com>
Fri, 26 Apr 2013 20:40:06 +0000 (13:40 -0700)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 543327b1f2a9efe8083bb196433c4bcf83883269)

src/ceph-disk

index 4d78507706dcbef55e87114916457f916da65127..f8c18b41d492769410710d8cb5e1f804c2688135 100755 (executable)
@@ -461,7 +461,7 @@ def dmcrypt_map(
         return dev
 
     except subprocess.CalledProcessError as e:
-        raise Error('unable to map device', rawdev)
+        raise Error('unable to map device', rawdev, e)
 
 
 def dmcrypt_unmap(
@@ -477,7 +477,7 @@ def dmcrypt_unmap(
         subprocess.check_call(args)
 
     except subprocess.CalledProcessError as e:
-        raise Error('unable to unmap device', _uuid)
+        raise Error('unable to unmap device', _uuid, e)
 
 
 def mount(
@@ -548,7 +548,7 @@ def get_free_partition_index(dev):
                 ],
             )
     except subprocess.CalledProcessError as e:
-        print 'cannot read partition index; assume it isn\'t present\n'
+        print 'cannot read partition index; assume it isn\'t present\n (Error: %s)' % e
         return 1
 
     if not lines: