Strip out novaclient extra attributes

Change-Id: Iec82b2d1b2d03ddc47e19646bf13148255d92bc4
This commit is contained in:
Monty Taylor 2017-03-25 09:55:13 -05:00
parent 76d78507fa
commit 35ab23efc8
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
2 changed files with 5 additions and 9 deletions

View File

@ -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():

View File

@ -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()