summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils/heat_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'snaps/openstack/utils/heat_utils.py')
-rw-r--r--snaps/openstack/utils/heat_utils.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/snaps/openstack/utils/heat_utils.py b/snaps/openstack/utils/heat_utils.py
index ad354e0..02b4f7c 100644
--- a/snaps/openstack/utils/heat_utils.py
+++ b/snaps/openstack/utils/heat_utils.py
@@ -197,14 +197,32 @@ def get_stack_networks(heat_cli, neutron, stack):
out = list()
resources = get_resources(heat_cli, stack, 'OS::Neutron::Net')
for resource in resources:
- network = neutron_utils.get_network_by_id(
- neutron, resource.id)
+ network = neutron_utils.get_network_by_id(neutron, resource.id)
if network:
out.append(network)
return out
+def get_stack_routers(heat_cli, neutron, stack):
+ """
+ Returns a list of Network domain objects deployed by this stack
+ :param heat_cli: the OpenStack heat client object
+ :param neutron: the OpenStack neutron client object
+ :param stack: the SNAPS-OO Stack domain object
+ :return: a list of Network objects
+ """
+
+ out = list()
+ resources = get_resources(heat_cli, stack, 'OS::Neutron::Router')
+ for resource in resources:
+ router = neutron_utils.get_router_by_id(neutron, resource.id)
+ if router:
+ out.append(router)
+
+ return out
+
+
def get_stack_servers(heat_cli, nova, stack):
"""
Returns a list of VMInst domain objects associated with a Stack