Updating address pairs with xml doesn't work

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
This commit is contained in:
zhhuabj 2013-10-12 17:31:38 +08:00
parent 8ed9b2c2c0
commit 893e10b0ad
2 changed files with 6 additions and 4 deletions

View File

@ -117,6 +117,8 @@ class Allowedaddresspairs(object):
def get_extended_resources(self, version): def get_extended_resources(self, version):
if version == "2.0": if version == "2.0":
attr.PLURALS.update({'allowed_address_pairs':
'allowed_address_pair'})
return EXTENDED_ATTRIBUTES_2_0 return EXTENDED_ATTRIBUTES_2_0
else: else:
return {} return {}

View File

@ -99,10 +99,6 @@ class AllowedAddressPairDBTestCase(AllowedAddressPairTestCase):
super(AllowedAddressPairDBTestCase, self).tearDown() super(AllowedAddressPairDBTestCase, self).tearDown()
class AllowedAddressPairDBTestCaseXML(AllowedAddressPairDBTestCase):
fmt = 'xml'
class TestAllowedAddressPairs(AllowedAddressPairDBTestCase): class TestAllowedAddressPairs(AllowedAddressPairDBTestCase):
def test_create_port_allowed_address_pairs(self): def test_create_port_allowed_address_pairs(self):
@ -297,3 +293,7 @@ class TestAllowedAddressPairs(AllowedAddressPairDBTestCase):
port = self.deserialize(self.fmt, req.get_response(self.api)) port = self.deserialize(self.fmt, req.get_response(self.api))
self.assertEqual(port['port'][addr_pair.ADDRESS_PAIRS], []) self.assertEqual(port['port'][addr_pair.ADDRESS_PAIRS], [])
self._delete('ports', port['port']['id']) self._delete('ports', port['port']['id'])
class TestAllowedAddressPairsXML(TestAllowedAddressPairs):
fmt = 'xml'