]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-disk: PEP8ify
authorAnirudha Bose <ani07nov@gmail.com>
Wed, 17 Aug 2016 06:49:33 +0000 (12:19 +0530)
committerAnirudha Bose <ani07nov@gmail.com>
Wed, 17 Aug 2016 07:34:32 +0000 (13:04 +0530)
Signed-off-by: Anirudha Bose <ani07nov@gmail.com>
src/ceph-disk/ceph_disk/main.py
src/ceph-disk/setup.py

index a252cb48be299481945e593a9df504af003f79cd..32fbb2111ae74afa756fd717a1612fbe4f0ede18 100755 (executable)
@@ -38,7 +38,6 @@ import time
 import shlex
 import pwd
 import grp
-import types
 import textwrap
 
 CEPH_OSD_ONDISK_MAGIC = 'ceph osd volume v026'
@@ -1401,7 +1400,7 @@ def update_partition(dev, description):
     partprobe_ok = False
     error = 'unknown error'
     partprobe = _get_command_executable(['partprobe'])[0]
-    for i in (1, 2, 3, 4, 5):
+    for i in range(5):
         command_check_call(['udevadm', 'settle', '--timeout=600'])
         try:
             _check_output(['flock', '-s', dev, partprobe, dev])
@@ -3128,7 +3127,7 @@ def mount_activate(
                 fstype=fstype,
                 mount_options=mount_options,
             )
-        return (cluster, osd_id)
+        return cluster, osd_id
 
     except:
         LOG.error('Failed to activate')
@@ -3178,7 +3177,7 @@ def activate_dir(
                     raise Error('unable to create symlink %s -> %s'
                                 % (canonical, path))
 
-    return (cluster, osd_id)
+    return cluster, osd_id
 
 
 def find_cluster_by_uuid(_uuid):
@@ -3573,7 +3572,7 @@ def _remove_lockbox(uuid):
     command(['umount', canonical])
     for name in os.listdir(lockbox):
         path = os.path.join(lockbox, name)
-        if (os.path.islink(path) and os.readlink(path) == canonical):
+        if os.path.islink(path) and os.readlink(path) == canonical:
             os.unlink(path)
 
 
@@ -3603,7 +3602,7 @@ def destroy_lookup_device(args, predicate, description):
             else:
                 dmcrypt = False
             if predicate(partition):
-                return (dmcrypt, partition)
+                return dmcrypt, partition
     raise Error('found no device matching ', description)
 
 
@@ -3844,7 +3843,7 @@ def split_dev_base_partnum(dev):
         b = block_path(dev)
         partnum = open(os.path.join(b, 'partition')).read().strip()
         base = get_partition_base(dev)
-    return (base, partnum)
+    return base, partnum
 
 
 def get_partition_type(part):
@@ -4530,7 +4529,7 @@ def make_trigger_parser(subparsers):
     trigger_parser.add_argument(
         '--sync',
         action='store_true', default=None,
-        help=('do operation synchronously; do not trigger systemd'),
+        help='do operation synchronously; do not trigger systemd',
     )
     trigger_parser.set_defaults(
         func=main_trigger,
index f1d185377d510d443536c80a9f715c212e16e944..cc7ad2a81ce22871792697c9a72677b1be6dd955 100644 (file)
@@ -21,6 +21,7 @@ from setuptools import find_packages
 assert sys.version_info >= (2, 7), \
     "Python version lower than 2.7 is not supported"
 
+
 def read(fname):
     path = os.path.join(os.path.dirname(__file__), fname)
     f = open(path)