Skip to content

Commit

Permalink
Updating address pairs with xml doesn't work
Browse files Browse the repository at this point in the history
Below command can't work because list element
"allowed_address_pairs" hasn't been updated
into the varaiable "attr.PLURALS"
"neutron port-update <port-uuid> \
--allowed-address-pairs list=true type=dict \
ip_address=10.0.0.1 --request-format xml"

Change-Id: I0d7dcca5f4848bc968f5c86fbeb46569c70c8fcd
Closes-Bug: #1229954
  • Loading branch information
zhhuabj committed Oct 15, 2013
1 parent 8ed9b2c commit 893e10b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions neutron/extensions/allowedaddresspairs.py
Expand Up @@ -117,6 +117,8 @@ def get_updated(cls):

def get_extended_resources(self, version):
if version == "2.0":
attr.PLURALS.update({'allowed_address_pairs':
'allowed_address_pair'})
return EXTENDED_ATTRIBUTES_2_0
else:
return {}
8 changes: 4 additions & 4 deletions neutron/tests/unit/test_extension_allowedaddresspairs.py
Expand Up @@ -99,10 +99,6 @@ def tearDown(self):
super(AllowedAddressPairDBTestCase, self).tearDown()


class AllowedAddressPairDBTestCaseXML(AllowedAddressPairDBTestCase):
fmt = 'xml'


class TestAllowedAddressPairs(AllowedAddressPairDBTestCase):

def test_create_port_allowed_address_pairs(self):
Expand Down Expand Up @@ -297,3 +293,7 @@ def test_create_port_remove_allowed_address_pairs(self):
port = self.deserialize(self.fmt, req.get_response(self.api))
self.assertEqual(port['port'][addr_pair.ADDRESS_PAIRS], [])
self._delete('ports', port['port']['id'])


class TestAllowedAddressPairsXML(TestAllowedAddressPairs):
fmt = 'xml'

0 comments on commit 893e10b

Please sign in to comment.