From: Patrick Seidensal Date: Mon, 18 May 2020 11:35:09 +0000 (+0200) Subject: mgr/cephadm: reformat according to pep8 X-Git-Tag: v16.1.0~2218^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=07583d261d95868cdecd131d3a588f8d3142acc3;p=ceph.git mgr/cephadm: reformat according to pep8 Signed-off-by: Patrick Seidensal --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index d862de045e9e..b50b363a1cb3 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -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, diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 24d44ddf3cc5..9cb3e6e9539a 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -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', '-'])