Merge "Don't modify objects directly"

This commit is contained in:
Zuul 2018-02-20 01:02:19 +00:00 committed by Gerrit Code Review
commit 55d50636c6
1 changed files with 3 additions and 2 deletions

View File

@ -149,9 +149,10 @@ class IptablesFirewallTestCase(test.NoDBTestCase):
inst.info_cache.deleted = False
return inst
@mock.patch.object(linux_net.iptables_manager, "execute")
@mock.patch.object(objects.InstanceList, "get_by_security_group_id")
@mock.patch.object(objects.SecurityGroupRuleList, "get_by_instance")
def test_static_filters(self, mock_secrule, mock_instlist):
def test_static_filters(self, mock_secrule, mock_instlist, fake_execute):
UUID = "2674993b-6adb-4733-abd9-a7c10cc1f146"
SRC_UUID = "0e0a76b2-7c52-4bc0-9a60-d83017e42c1a"
instance_ref = self._create_instance_ref(UUID)
@ -247,7 +248,7 @@ class IptablesFirewallTestCase(test.NoDBTestCase):
network_model = _fake_network_info(self, 1)
linux_net.iptables_manager.execute = fake_iptables_execute
fake_execute.side_effect = fake_iptables_execute
self.stub_out('nova.objects.Instance.get_network_info',
lambda instance: network_model)