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)
@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()
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)
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,
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,
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':
'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':
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', '-'])