From: Patrick Seidensal Date: Mon, 18 May 2020 11:35:09 +0000 (+0200) Subject: mgr/cephadm: reformat according to pep8 X-Git-Tag: v15.2.4~69^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=44a741b6cbb41737c3e16080d9f6b2b21d8781c0;p=ceph.git mgr/cephadm: reformat according to pep8 Signed-off-by: Patrick Seidensal (cherry picked from commit 07583d261d95868cdecd131d3a588f8d3142acc3) --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index b6917bf1d0be..3f29e7f6abdf 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) @@ -2689,7 +2689,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() @@ -2711,8 +2711,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) @@ -2742,7 +2742,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, @@ -2751,17 +2750,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 8574ad9489e5..bfdc62bbe2e5 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -942,7 +942,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': @@ -952,7 +952,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': @@ -1620,7 +1620,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', '-'])