]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/cephadm: reformat according to pep8
authorPatrick Seidensal <pseidensal@suse.com>
Mon, 18 May 2020 11:35:09 +0000 (13:35 +0200)
committerPatrick Seidensal <pseidensal@suse.com>
Tue, 26 May 2020 10:49:34 +0000 (12:49 +0200)
Signed-off-by: Patrick Seidensal <pseidensal@suse.com>
src/cephadm/cephadm
src/pybind/mgr/cephadm/module.py

index d862de045e9e87b19804939610d2264c910f995a..b50b363a1cb3e73a6ebee50251f7cffcdad1142a 100755 (executable)
@@ -484,7 +484,7 @@ def attempt_bind(s, address, port):
 def port_in_use(port_num):
     # type (int) -> bool
     """Detect whether a port is in use on the local machine - IPv4 and IPv6"""
-    logger.info('Verifying port %d ...' % (port_num))
+    logger.info('Verifying port %d ...' % port_num)
     try:
         s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         attempt_bind(s, '0.0.0.0', port_num)
@@ -2673,7 +2673,7 @@ def extract_uid_gid_monitoring(daemon_type):
 @default_image
 def command_deploy():
     # type: () -> None
-    (daemon_type, daemon_id) = args.name.split('.', 1)
+    daemon_type, daemon_id = args.name.split('.', 1)
 
     l = FileLock(args.fsid)
     l.acquire()
@@ -2695,8 +2695,8 @@ def command_deploy():
         logger.info('%s daemon %s ...' % ('Deploy', args.name))
 
     if daemon_type in Ceph.daemons:
-        (config, keyring) = get_config_and_keyring()
-        (uid, gid) = extract_uid_gid()
+        config, keyring = get_config_and_keyring()
+        uid, gid = extract_uid_gid()
         make_var_run(args.fsid, uid, gid)
         c = get_container(args.fsid, daemon_type, daemon_id,
                           ptrace=args.allow_ptrace)
@@ -2726,7 +2726,6 @@ def command_deploy():
                 raise Error("{} deployment requires config-json which must "
                             "contain arg for {}".format(daemon_type.capitalize(), ', '.join(required_args)))
 
-
         uid, gid = extract_uid_gid_monitoring(daemon_type)
         c = get_container(args.fsid, daemon_type, daemon_id)
         deploy_daemon(args.fsid, daemon_type, daemon_id, c, uid, gid,
@@ -2735,17 +2734,17 @@ def command_deploy():
     elif daemon_type == NFSGanesha.daemon_type:
         if not args.reconfig and not redeploy:
             NFSGanesha.port_in_use()
-        (config, keyring) = get_config_and_keyring()
+        config, keyring = get_config_and_keyring()
         # TODO: extract ganesha uid/gid (997, 994) ?
-        (uid, gid) = extract_uid_gid()
+        uid, gid = extract_uid_gid()
         c = get_container(args.fsid, daemon_type, daemon_id)
         deploy_daemon(args.fsid, daemon_type, daemon_id, c, uid, gid,
                       config=config, keyring=keyring,
                       reconfig=args.reconfig)
 
     elif daemon_type == CephIscsi.daemon_type:
-        (config, keyring) = get_config_and_keyring()
-        (uid, gid) = extract_uid_gid()
+        config, keyring = get_config_and_keyring()
+        uid, gid = extract_uid_gid()
         c = get_container(args.fsid, daemon_type, daemon_id)
         deploy_daemon(args.fsid, daemon_type, daemon_id, c, uid, gid,
                       config=config, keyring=keyring,
index 24d44ddf3cc59015fd04c9684c6852ba33705e9f..9cb3e6e9539a0c3ebf0944fb5f63c3033136f7cf 100644 (file)
@@ -908,7 +908,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule):
 
             assert image or entity
             if not image:
-                daemon_type = entity.split('.', 1)[0] # type: ignore
+                daemon_type = entity.split('.', 1)[0]  # type: ignore
                 if daemon_type in CEPH_TYPES or \
                         daemon_type == 'nfs' or \
                         daemon_type == 'iscsi':
@@ -918,7 +918,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule):
                         'who': utils.name_to_config_section(entity),
                         'key': 'container_image',
                     })
-                    image = image.strip() # type: ignore
+                    image = image.strip()  # type: ignore
                 elif daemon_type == 'prometheus':
                     image = self.container_image_prometheus
                 elif daemon_type == 'grafana':
@@ -1587,7 +1587,7 @@ you may want to run:
 
         start_time = datetime.datetime.utcnow()
         deps = []  # type: List[str]
-        cephadm_config = {} # type: Dict[str, Any]
+        cephadm_config = {}  # type: Dict[str, Any]
         if daemon_type == 'prometheus':
             cephadm_config, deps = self.prometheus_service.generate_config()
             extra_args.extend(['--config-json', '-'])