Unit tests: tidy up resolve_runtime_data() calls
It's not clear whether these were ever needed or just cargo-culting, but they are definitely not doing anything now. Change-Id: I9dd409332a93e39640da93a22cf7d3c676f398ac
This commit is contained in:
parent
a94239a107
commit
062b5e99ca
@ -155,7 +155,6 @@ class CloudServersTest(HeatTestCase):
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
server._private_key = rsa_key
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
|
||||
if stub_create:
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
@ -671,7 +670,6 @@ class CloudServersTest(HeatTestCase):
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
server._private_key = rsa_key
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
self.fc.servers.create(
|
||||
@ -761,7 +759,6 @@ class CloudServersTest(HeatTestCase):
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
server._private_key = rsa_key
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
self.fc.servers.create(
|
||||
@ -816,7 +813,6 @@ class CloudServersTest(HeatTestCase):
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
server._private_key = rsa_key
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
self.fc.servers.create(
|
||||
@ -906,7 +902,6 @@ class CloudServersTest(HeatTestCase):
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
server._private_key = rsa_key
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
self.fc.servers.create(
|
||||
@ -966,7 +961,6 @@ class CloudServersTest(HeatTestCase):
|
||||
server._run_ssh_command = mock.Mock(return_value=0)
|
||||
|
||||
mock_nova.return_value = self.fc
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
self.fc.servers.create = mock.Mock(return_value=return_server)
|
||||
|
||||
scheduler.TaskRunner(server.create)()
|
||||
@ -992,7 +986,6 @@ class CloudServersTest(HeatTestCase):
|
||||
server._run_ssh_command = mock.Mock(return_value=0)
|
||||
|
||||
mock_nova.return_value = self.fc
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
self.fc.servers.create = mock.Mock(return_value=return_server)
|
||||
|
||||
scheduler.TaskRunner(server.create)()
|
||||
@ -1018,7 +1011,6 @@ class CloudServersTest(HeatTestCase):
|
||||
server._run_ssh_command = mock.Mock(return_value=0)
|
||||
|
||||
mock_nova.return_value = self.fc
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
self.fc.servers.create = mock.Mock(return_value=return_server)
|
||||
|
||||
scheduler.TaskRunner(server.create)()
|
||||
@ -1042,7 +1034,6 @@ class CloudServersTest(HeatTestCase):
|
||||
server._run_ssh_command = mock.Mock(return_value=0)
|
||||
|
||||
mock_nova.return_value = self.fc
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
self.fc.servers.create = mock.Mock(return_value=return_server)
|
||||
|
||||
scheduler.TaskRunner(server.create)()
|
||||
|
@ -108,7 +108,6 @@ class RackspaceDnsTest(common.HeatTestCase):
|
||||
'%s_name' % name,
|
||||
t['Resources']['domain'],
|
||||
stack)
|
||||
instance.t = instance.stack.resolve_runtime_data(instance.t)
|
||||
return instance
|
||||
|
||||
def _stubout_create(self, instance, fake_dnsinstance, **create_args):
|
||||
|
@ -93,8 +93,6 @@ class InstancesTest(HeatTestCase):
|
||||
self.m.StubOutWithMock(clients.OpenStackClients, 'nova')
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
instance.t = instance.stack.resolve_runtime_data(instance.t)
|
||||
|
||||
if stub_create:
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
self.fc.servers.create(
|
||||
|
@ -172,8 +172,6 @@ class instancesTest(HeatTestCase):
|
||||
self.m.StubOutWithMock(instance, 'neutron')
|
||||
instance.neutron().MultipleTimes().AndReturn(FakeNeutron())
|
||||
|
||||
instance.t = instance.stack.resolve_runtime_data(instance.t)
|
||||
|
||||
# need to resolve the template functions
|
||||
server_userdata = nova_utils.build_userdata(
|
||||
instance,
|
||||
@ -227,9 +225,6 @@ class instancesTest(HeatTestCase):
|
||||
self.m.StubOutWithMock(clients.OpenStackClients, 'nova')
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
nic.t = nic.stack.resolve_runtime_data(nic.t)
|
||||
instance.t = instance.stack.resolve_runtime_data(instance.t)
|
||||
|
||||
# need to resolve the template functions
|
||||
server_userdata = nova_utils.build_userdata(
|
||||
instance,
|
||||
|
@ -62,8 +62,6 @@ class nokeyTest(HeatTestCase):
|
||||
self.m.StubOutWithMock(clients.OpenStackClients, 'nova')
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
instance.t = instance.stack.resolve_runtime_data(instance.t)
|
||||
|
||||
# need to resolve the template functions
|
||||
server_userdata = nova_utils.build_userdata(
|
||||
instance,
|
||||
|
@ -105,7 +105,6 @@ class OSDBInstanceTest(HeatTestCase):
|
||||
'%s_name' % name,
|
||||
t['Resources']['MySqlCloudDB'],
|
||||
stack)
|
||||
instance.t = instance.stack.resolve_runtime_data(instance.t)
|
||||
return instance
|
||||
|
||||
def _stubout_create(self, instance, fake_dbinstance):
|
||||
|
@ -119,8 +119,6 @@ class ServersTest(HeatTestCase):
|
||||
self.m.StubOutWithMock(clients.OpenStackClients, 'nova')
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
|
||||
if stub_create:
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
self.fc.servers.create(
|
||||
@ -209,7 +207,6 @@ class ServersTest(HeatTestCase):
|
||||
{'a': 1}
|
||||
server = servers.Server('create_metadata_test_server',
|
||||
t['Resources']['WebServer'], stack)
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
|
||||
instance_meta = {'a': "1"}
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
@ -398,8 +395,6 @@ class ServersTest(HeatTestCase):
|
||||
self.m.StubOutWithMock(clients.OpenStackClients, 'nova')
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
self.fc.servers.create(
|
||||
image=744, flavor=3, key_name='test',
|
||||
@ -441,8 +436,6 @@ class ServersTest(HeatTestCase):
|
||||
self.m.StubOutWithMock(clients.OpenStackClients, 'nova')
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
self.fc.servers.create(
|
||||
image=744, flavor=3, key_name='test',
|
||||
@ -484,8 +477,6 @@ class ServersTest(HeatTestCase):
|
||||
self.m.StubOutWithMock(clients.OpenStackClients, 'nova')
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
self.fc.servers.create(
|
||||
image=744, flavor=3, key_name='test',
|
||||
@ -528,8 +519,6 @@ class ServersTest(HeatTestCase):
|
||||
server._get_deployments_metadata(
|
||||
self.fc, 5678).AndReturn({'foo': 'bar'})
|
||||
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
self.fc.servers.create(
|
||||
image=744, flavor=3, key_name='test',
|
||||
@ -599,8 +588,6 @@ class ServersTest(HeatTestCase):
|
||||
server._get_deployments_metadata(
|
||||
self.fc, 5678).AndReturn({'foo': 'bar'})
|
||||
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
self.fc.servers.create(
|
||||
image=744, flavor=3, key_name='test',
|
||||
@ -653,7 +640,6 @@ class ServersTest(HeatTestCase):
|
||||
server = servers.Server('WebServer',
|
||||
t['Resources']['WebServer'], stack)
|
||||
self.m.StubOutWithMock(server, 'keystone')
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
self.m.ReplayAll()
|
||||
deployments = server.metadata['deployments']
|
||||
self.assertEqual([], deployments)
|
||||
@ -670,7 +656,6 @@ class ServersTest(HeatTestCase):
|
||||
t['Resources']['WebServer'], stack)
|
||||
|
||||
mock_nova.return_value = self.fc
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
self.fc.servers.create = mock.Mock(return_value=return_server)
|
||||
|
||||
scheduler.TaskRunner(server.create)()
|
||||
@ -696,7 +681,6 @@ class ServersTest(HeatTestCase):
|
||||
t['Resources']['WebServer'], stack)
|
||||
|
||||
mock_nova.return_value = self.fc
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
self.fc.servers.create = mock.Mock(return_value=return_server)
|
||||
|
||||
scheduler.TaskRunner(server.create)()
|
||||
@ -1963,7 +1947,6 @@ class ServersTest(HeatTestCase):
|
||||
t['Resources']['WebServer']['Properties']['admin_user'] = 'custom_user'
|
||||
server = servers.Server('create_metadata_test_server',
|
||||
t['Resources']['WebServer'], stack)
|
||||
server.t = server.stack.resolve_runtime_data(server.t)
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
self.fc.servers.create(
|
||||
image=mox.IgnoreArg(), flavor=mox.IgnoreArg(), key_name='test',
|
||||
|
@ -146,8 +146,6 @@ class ServerTagsTest(HeatTestCase):
|
||||
self.m.StubOutWithMock(clients.OpenStackClients, 'nova')
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
instance.t = instance.stack.resolve_runtime_data(instance.t)
|
||||
|
||||
# need to resolve the template functions
|
||||
server_userdata = nova_utils.build_userdata(
|
||||
instance,
|
||||
@ -237,8 +235,6 @@ class ServerTagsTest(HeatTestCase):
|
||||
self.m.StubOutWithMock(clients.OpenStackClients, 'nova')
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
group.t = group.stack.resolve_runtime_data(group.t)
|
||||
|
||||
# need to resolve the template functions
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
self.fc.servers.create(
|
||||
@ -290,8 +286,6 @@ class ServerTagsTest(HeatTestCase):
|
||||
self.m.StubOutWithMock(clients.OpenStackClients, 'nova')
|
||||
clients.OpenStackClients.nova().MultipleTimes().AndReturn(self.fc)
|
||||
|
||||
group.t = group.stack.resolve_runtime_data(group.t)
|
||||
|
||||
# need to resolve the template functions
|
||||
self.m.StubOutWithMock(self.fc.servers, 'create')
|
||||
self.fc.servers.create(
|
||||
|
Loading…
Reference in New Issue
Block a user