diff --git a/zunclient/osc/v1/containers.py b/zunclient/osc/v1/containers.py index 0406c717..c12aa3a8 100644 --- a/zunclient/osc/v1/containers.py +++ b/zunclient/osc/v1/containers.py @@ -230,7 +230,8 @@ class CreateContainer(command.ShowOne): opts['hostname'] = parsed_args.hostname opts['disk'] = parsed_args.disk opts['availability_zone'] = parsed_args.availability_zone - opts['auto_heal'] = parsed_args.auto_heal + if parsed_args.auto_heal: + opts['auto_heal'] = parsed_args.auto_heal if parsed_args.healthcheck: opts['healthcheck'] = \ zun_utils.parse_health(parsed_args.healthcheck) @@ -872,7 +873,8 @@ class RunContainer(command.ShowOne): opts['hostname'] = parsed_args.hostname opts['disk'] = parsed_args.disk opts['availability_zone'] = parsed_args.availability_zone - opts['auto_heal'] = parsed_args.auto_heal + if parsed_args.auto_heal: + opts['auto_heal'] = parsed_args.auto_heal if parsed_args.healthcheck: opts['healthcheck'] = \ zun_utils.parse_health(parsed_args.healthcheck) diff --git a/zunclient/tests/unit/v1/test_containers_shell.py b/zunclient/tests/unit/v1/test_containers_shell.py index 6da59d99..946b113b 100644 --- a/zunclient/tests/unit/v1/test_containers_shell.py +++ b/zunclient/tests/unit/v1/test_containers_shell.py @@ -21,7 +21,6 @@ from zunclient.v1 import containers_shell def _get_container_args(**kwargs): default_args = { - 'auto_heal': False, 'auto_remove': False, 'environment': {}, 'hints': {}, diff --git a/zunclient/v1/containers_shell.py b/zunclient/v1/containers_shell.py index bc5922f0..dcc63f95 100644 --- a/zunclient/v1/containers_shell.py +++ b/zunclient/v1/containers_shell.py @@ -185,11 +185,12 @@ def do_create(cs, args): opts['hostname'] = args.hostname opts['disk'] = args.disk opts['availability_zone'] = args.availability_zone - opts['auto_heal'] = args.auto_heal opts['command'] = args.command if args.healthcheck: opts['healthcheck'] = zun_utils.parse_health(args.healthcheck) + if args.auto_heal: + opts['auto_heal'] = args.auto_heal if args.security_group: opts['security_groups'] = args.security_group if args.restart: @@ -693,11 +694,12 @@ def do_run(cs, args): opts['hostname'] = args.hostname opts['disk'] = args.disk opts['availability_zone'] = args.availability_zone - opts['auto_heal'] = args.auto_heal opts['command'] = args.command if args.healthcheck: opts['healthcheck'] = zun_utils.parse_health(args.healthcheck) + if args.auto_heal: + opts['auto_heal'] = args.auto_heal if args.security_group: opts['security_groups'] = args.security_group if args.restart: