summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-10-06 09:37:18 +0000
committerGerrit Code Review <review@openstack.org>2015-10-06 09:37:18 +0000
commit89e1dac7de2cfeddf44809f916b58a15111be29a (patch)
treea84d1c3c6229a49c832a015f002c902fb17fc95d
parent8a38f4fdb43f1193713d48cc2c1faeb9a9230f2c (diff)
parent413f5c1b4d1214901295993d835259fe9a00ad44 (diff)
downloadheat-89e1dac7de2cfeddf44809f916b58a15111be29a.tar.gz
Merge "Make sure we can use nova-network" into stable/liberty
-rw-r--r--heat/engine/resources/openstack/nova/server_network_mixin.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/heat/engine/resources/openstack/nova/server_network_mixin.py b/heat/engine/resources/openstack/nova/server_network_mixin.py
index 569fd1f63..c2a0dc83d 100644
--- a/heat/engine/resources/openstack/nova/server_network_mixin.py
+++ b/heat/engine/resources/openstack/nova/server_network_mixin.py
@@ -159,6 +159,9 @@ class ServerNetworkMixin(object):
creating. We need to store information about that ports, so store
their IDs to data with key `external_ports`.
"""
+ if not self.is_using_neutron():
+ return
+
server = self.client().servers.get(self.resource_id)
ifaces = server.interface_list()
external_port_ids = set(iface.port_id for iface in ifaces)
@@ -331,6 +334,9 @@ class ServerNetworkMixin(object):
return remove_ports, add_nets
def prepare_ports_for_replace(self):
+ if not self.is_using_neutron():
+ return
+
data = {'external_ports': [],
'internal_ports': []}
port_data = itertools.chain(
@@ -356,6 +362,9 @@ class ServerNetworkMixin(object):
port['id'], {'port': {'fixed_ips': []}})
def restore_ports_after_rollback(self):
+ if not self.is_using_neutron():
+ return
+
old_server = self.stack._backup_stack().resources.get(self.name)
port_data = itertools.chain(self._data_get_ports(),