From 35ab23efc8bdf7bdc97b127d7712662e596f2b69 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 25 Mar 2017 09:55:13 -0500 Subject: [PATCH] Strip out novaclient extra attributes Change-Id: Iec82b2d1b2d03ddc47e19646bf13148255d92bc4 --- shade/openstackcloud.py | 4 +++- shade/tests/unit/test_floating_ip_pool.py | 10 ++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/shade/openstackcloud.py b/shade/openstackcloud.py index 405d46904..29dc76326 100644 --- a/shade/openstackcloud.py +++ b/shade/openstackcloud.py @@ -1960,7 +1960,9 @@ class OpenStackCloud(_normalize.Normalizer): 'Floating IP pools extension is not available on target cloud') with _utils.shade_exceptions("Error fetching floating IP pool list"): - return self.manager.submit_task(_tasks.FloatingIPPoolList()) + return [ + {'name': p['name']} for p in self.manager.submit_task( + _tasks.FloatingIPPoolList())] def _list_floating_ips(self, filters=None): if self._use_neutron_floating(): diff --git a/shade/tests/unit/test_floating_ip_pool.py b/shade/tests/unit/test_floating_ip_pool.py index 2870c5267..6ebdd9597 100644 --- a/shade/tests/unit/test_floating_ip_pool.py +++ b/shade/tests/unit/test_floating_ip_pool.py @@ -25,13 +25,7 @@ from shade.tests import fakes class TestFloatingIPPool(base.RequestsMockTestCase): - mock_pools = [{ - 'NAME_ATTR': 'name', - 'name': u'public', - 'x_openstack_request_ids': [], - 'request_ids': [], - 'HUMAN_ID': False, - 'human_id': None}] + pools = [{'name': u'public'}] def test_list_floating_ip_pools(self): @@ -55,7 +49,7 @@ class TestFloatingIPPool(base.RequestsMockTestCase): floating_ip_pools = self.cloud.list_floating_ip_pools() - self.assertItemsEqual(floating_ip_pools, self.mock_pools) + self.assertItemsEqual(floating_ip_pools, self.pools) self.assert_calls()