]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk-prepare: clean up stupid check for a digit
authorSage Weil <sage@inktank.com>
Tue, 5 Mar 2013 00:29:57 +0000 (16:29 -0800)
committerSage Weil <sage@inktank.com>
Fri, 26 Apr 2013 20:40:03 +0000 (13:40 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit f03f62697f170d42b4b62c53d2860ff2f24a2d73)

src/ceph-disk-prepare

index 0eca7c0cafb822ecc16472874590e37963b1c8d1..3dd7e2950c236bbb24c55cc749632d47c7ff3225 100755 (executable)
@@ -80,9 +80,7 @@ def is_partition(dev):
         raise PrepareError('not a block device', dev)
 
     # if the device ends in a number, it is a partition (e.g., /dev/sda3)
-
-    # ugh i have no internet.. how do you do a python regex?
-    if dev.endswith('0') or dev.endswith('1') or dev.endswith('2') or dev.endswith('3') or dev.endswith('4') or dev.endswith('4') or dev.endswith('6') or dev.endswith('7') or dev.endswith('8') or dev.endswith('9'):
+    if dev[-1].isdigit():
         return True
     return False