move securiy service error explanation from comment

Change-Id: If81d6cfd41e8aec63aaa95f3190eec44d7d2fc01
This commit is contained in:
Maurice Schreiber 2018-04-11 10:20:25 +02:00
parent 80e9298418
commit f1b20cd4a9
No known key found for this signature in database
GPG Key ID: D39C8CD40259CE1F
1 changed files with 3 additions and 3 deletions

View File

@ -66,9 +66,9 @@ class SecurityServiceController(wsgi.Controller):
share_nets = db.share_network_get_all_by_security_service(
context, id)
if share_nets:
# Cannot delete security service
# if it is assigned to share networks
raise exc.HTTPForbidden()
msg = _("Cannot delete security service. It is "
"assigned to share network(s)")
raise exc.HTTPForbidden(explanation=msg)
policy.check_policy(context, RESOURCE_NAME,
'delete', security_service)
db.security_service_delete(context, id)