diff --git a/zun/api/controllers/v1/containers.py b/zun/api/controllers/v1/containers.py index f34a02a54..ddf0e882c 100644 --- a/zun/api/controllers/v1/containers.py +++ b/zun/api/controllers/v1/containers.py @@ -671,19 +671,14 @@ class ContainersController(base.Controller): context.all_projects = True container = utils.get_container(container_ident) check_policy_on_container(container.as_dict(), "container:delete") - try: - force = strutils.bool_from_string(force, strict=True) - except ValueError: - bools = ', '.join(strutils.TRUE_STRINGS + strutils.FALSE_STRINGS) - raise exception.InvalidValue(_('Valid force values are: %s') - % bools) stop = kwargs.pop('stop', False) try: + force = strutils.bool_from_string(force, strict=True) stop = strutils.bool_from_string(stop, strict=True) except ValueError: bools = ', '.join(strutils.TRUE_STRINGS + strutils.FALSE_STRINGS) - raise exception.InvalidValue(_('Valid stop values are: %s') - % bools) + raise exception.InvalidValue(_('Valid force or stop values ' + 'are: %s') % bools) compute_api = pecan.request.compute_api if not force and not stop: utils.validate_container_state(container, 'delete')