Merge "Ensure to show security groups only from current project"
This commit is contained in:
commit
b4eb6b992e
@ -1856,7 +1856,7 @@ class InstanceTests(InstanceTestBase):
|
||||
self.mock_server_get.assert_called_once_with(
|
||||
helpers.IsHttpRequest(), server.id)
|
||||
self.mock_security_group_list.assert_called_once_with(
|
||||
helpers.IsHttpRequest(), tenant_id=None)
|
||||
helpers.IsHttpRequest(), tenant_id=self.tenant.id)
|
||||
self.mock_server_security_groups.assert_called_once_with(
|
||||
helpers.IsHttpRequest(), server.id)
|
||||
self.mock_server_update.assert_called_once_with(
|
||||
@ -1892,7 +1892,7 @@ class InstanceTests(InstanceTestBase):
|
||||
self.mock_server_get.assert_called_once_with(
|
||||
helpers.IsHttpRequest(), server.id)
|
||||
self.mock_security_group_list.assert_called_once_with(
|
||||
helpers.IsHttpRequest(), tenant_id=None)
|
||||
helpers.IsHttpRequest(), tenant_id=self.tenant.id)
|
||||
self.mock_server_security_groups.assert_called_once_with(
|
||||
helpers.IsHttpRequest(), server.id)
|
||||
self.mock_server_update.assert_called_once_with(
|
||||
@ -1919,7 +1919,7 @@ class InstanceTests(InstanceTestBase):
|
||||
self.mock_server_get.assert_called_once_with(
|
||||
helpers.IsHttpRequest(), server.id)
|
||||
self.mock_security_group_list.assert_called_once_with(
|
||||
helpers.IsHttpRequest(), tenant_id=None)
|
||||
helpers.IsHttpRequest(), tenant_id=self.tenant.id)
|
||||
self.mock_server_security_groups.assert_called_once_with(
|
||||
helpers.IsHttpRequest(), server.id)
|
||||
self.mock_server_update.assert_called_once_with(
|
||||
@ -1948,7 +1948,7 @@ class InstanceTests(InstanceTestBase):
|
||||
self.mock_server_get.assert_called_once_with(
|
||||
helpers.IsHttpRequest(), server.id)
|
||||
self.mock_security_group_list.assert_called_once_with(
|
||||
helpers.IsHttpRequest(), tenant_id=None)
|
||||
helpers.IsHttpRequest(), tenant_id=self.tenant.id)
|
||||
self.mock_server_security_groups.assert_called_once_with(
|
||||
helpers.IsHttpRequest(), server.id)
|
||||
self.mock_server_update.assert_called_once_with(
|
||||
|
@ -337,7 +337,8 @@ class UpdateView(workflows.WorkflowView):
|
||||
instance = self.get_object()
|
||||
initial.update({'instance_id': self.kwargs['instance_id'],
|
||||
'name': getattr(instance, 'name', ''),
|
||||
'description': getattr(instance, 'description', '')})
|
||||
'description': getattr(instance, 'description', ''),
|
||||
'target_tenant_id': self.request.user.tenant_id})
|
||||
return initial
|
||||
|
||||
|
||||
|
@ -119,7 +119,7 @@ class UpdateInstanceSecurityGroups(BaseSecurityGroups):
|
||||
members_list_title = _("Instance Security Groups")
|
||||
help_text = _("Add and remove security groups to this instance "
|
||||
"from the list of available security groups.")
|
||||
depends_on = ("instance_id",)
|
||||
depends_on = ("instance_id", "target_tenant_id")
|
||||
|
||||
def allowed(self, request):
|
||||
return api.base.is_service_enabled(request, 'network')
|
||||
|
Loading…
x
Reference in New Issue
Block a user