summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils/tests/neutron_utils_tests.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-08-02 13:19:58 -0600
committerspisarski <s.pisarski@cablelabs.com>2017-08-02 14:19:04 -0600
commit652da5487159d5ee94fe2f8e62c34fdb0d26f4e5 (patch)
tree2391e24e8bab3c92711fa96f6401b6e1b8c731ef /snaps/openstack/utils/tests/neutron_utils_tests.py
parent84d902632f1dd77f891c49cfb1d58af5ae051d1a (diff)
Refactor network retrieval API calls.
Refactored neutron_utils#get_network() to also accept a NetworkSettings object for more robust queries in addition to the old network_name parameter. Also refactored neutron_utils# get_network_by_id to add in the ID to list_networks((**{'id': id) and returning the first item contains the expected ID value. JIRA: SNAPS-161 Change-Id: Ie670a442dd70633bbef7a1233e630672ebac6b0c Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/utils/tests/neutron_utils_tests.py')
-rw-r--r--snaps/openstack/utils/tests/neutron_utils_tests.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/snaps/openstack/utils/tests/neutron_utils_tests.py b/snaps/openstack/utils/tests/neutron_utils_tests.py
index 82bb42e..0b9559a 100644
--- a/snaps/openstack/utils/tests/neutron_utils_tests.py
+++ b/snaps/openstack/utils/tests/neutron_utils_tests.py
@@ -319,7 +319,8 @@ class NeutronUtilsRouterTests(OSComponentTestCase):
validate_router(self.neutron, self.net_config.router_settings.name,
True)
- ext_net = neutron_utils.get_network(self.neutron, self.ext_net_name)
+ ext_net = neutron_utils.get_network(
+ self.neutron, network_name=self.ext_net_name)
self.assertEqual(
self.router.external_gateway_info['network_id'], ext_net.id)
@@ -805,7 +806,7 @@ def validate_network(neutron, name, exists):
:param exists: Whether or not the network name should exist or not
:return: True/False
"""
- network = neutron_utils.get_network(neutron, name)
+ network = neutron_utils.get_network(neutron, network_name=name)
if exists and network:
return True
if not exists and not network: