Merge pull request #39385 from adk3798/error-redeploy

cephadm: allow redeploy of daemons in error state if container running

Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
This commit is contained in:
Sebastian Wagner 2021-02-13 01:57:38 +01:00 committed by GitHub
commit 3ebdf38429
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1972,6 +1972,13 @@ def check_units(ctx, units, enabler=None):
return False
def is_container_running(ctx: CephadmContext, name: str) -> bool:
out, err, ret = call_throws(ctx, [
ctx.container_path, 'ps',
'--format', '{{.Names}}'])
return name in out
def get_legacy_config_fsid(cluster, legacy_dir=None):
# type: (str, Optional[str]) -> Optional[str]
config_file = '/etc/ceph/%s.conf' % cluster
@ -3979,8 +3986,9 @@ def command_deploy(ctx):
redeploy = False
unit_name = get_unit_name(ctx.fsid, daemon_type, daemon_id)
container_name = 'ceph-%s-%s.%s' % (ctx.fsid, daemon_type, daemon_id)
(_, state, _) = check_unit(ctx, unit_name)
if state == 'running':
if state == 'running' or is_container_running(ctx, container_name):
redeploy = True
if ctx.reconfig: