check the security group has been added to the container
Change-Id: I06f60fceb6116d2bb7189426295757b5abe5598c
This commit is contained in:
parent
2ed50d1163
commit
c0d770a62f
@ -427,6 +427,10 @@ class ContainersController(base.Controller):
|
||||
context = pecan.request.context
|
||||
compute_api = pecan.request.compute_api
|
||||
security_group_id = self._check_security_group(context, security_group)
|
||||
if security_group_id in container.security_groups:
|
||||
msg = _("Security group %(id)s has been added to container.") % {
|
||||
'id': security_group_id}
|
||||
raise exception.InvalidValue(msg)
|
||||
compute_api.add_security_group(context, container,
|
||||
security_group_id)
|
||||
pecan.response.status = 202
|
||||
|
Loading…
Reference in New Issue
Block a user