Merge "Remove some useless code of flavor unset command"
This commit is contained in:
commit
bbcfb8d8fc
@ -257,20 +257,10 @@ class UnsetFlavor(command.Command):
|
|||||||
bc_client.flavor,
|
bc_client.flavor,
|
||||||
parsed_args.flavor,
|
parsed_args.flavor,
|
||||||
)
|
)
|
||||||
|
|
||||||
result = 0
|
|
||||||
if parsed_args.project:
|
if parsed_args.project:
|
||||||
try:
|
|
||||||
if data.is_public:
|
if data.is_public:
|
||||||
msg = _("Cannot remove access for a public flavor")
|
msg = _("Cannot remove access for a public flavor")
|
||||||
raise exceptions.CommandError(msg)
|
raise exceptions.CommandError(msg)
|
||||||
else:
|
else:
|
||||||
bc_client.flavor.remove_tenant_access(
|
bc_client.flavor.remove_tenant_access(
|
||||||
data, parsed_args.project)
|
data, parsed_args.project)
|
||||||
except Exception as e:
|
|
||||||
LOG.error("Failed to remove flavor access to project: %s", e)
|
|
||||||
result += 1
|
|
||||||
|
|
||||||
if result > 0:
|
|
||||||
raise exceptions.CommandError(_("Command Failed: One or more of"
|
|
||||||
" the operations failed"))
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user