Merge "Remove 'validate' key in 'type:dict_or_nodata' type"
This commit is contained in:
@@ -32,7 +32,7 @@ EXTENDED_ATTRIBUTES_2_0 = {
|
|||||||
'convert_to': attrs.convert_to_boolean},
|
'convert_to': attrs.convert_to_boolean},
|
||||||
'external_fixed_ips': {
|
'external_fixed_ips': {
|
||||||
'convert_list_to': attrs.convert_kvp_list_to_dict,
|
'convert_list_to': attrs.convert_kvp_list_to_dict,
|
||||||
'validate': {'type:fixed_ips': None},
|
'type:fixed_ips': None,
|
||||||
'default': None,
|
'default': None,
|
||||||
'required': False}
|
'required': False}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
import mock
|
import mock
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
from oslo_serialization import jsonutils
|
||||||
from oslo_utils import uuidutils
|
from oslo_utils import uuidutils
|
||||||
import testscenarios
|
import testscenarios
|
||||||
from webob import exc
|
from webob import exc
|
||||||
@@ -388,6 +389,24 @@ class ExtGwModeIntTestCase(test_db_base_plugin_v2.NeutronDbPluginV2TestCase,
|
|||||||
expected_code=expected_code,
|
expected_code=expected_code,
|
||||||
neutron_context=neutron_context)
|
neutron_context=neutron_context)
|
||||||
|
|
||||||
|
def test_router_create_with_gwinfo_invalid_ext_ip(self):
|
||||||
|
with self.subnet() as s:
|
||||||
|
self._set_net_external(s['subnet']['network_id'])
|
||||||
|
ext_info = {
|
||||||
|
'network_id': s['subnet']['network_id'],
|
||||||
|
'external_fixed_ips': [{'ip_address': '10.0.0.'}]
|
||||||
|
}
|
||||||
|
error_code = exc.HTTPBadRequest.code
|
||||||
|
res = self._create_router(
|
||||||
|
self.fmt, _uuid(), arg_list=('external_gateway_info',),
|
||||||
|
external_gateway_info=ext_info,
|
||||||
|
expected_code=error_code
|
||||||
|
)
|
||||||
|
msg = ("Invalid input for external_gateway_info. "
|
||||||
|
"Reason: '10.0.0.' is not a valid IP address.")
|
||||||
|
body = jsonutils.loads(res.body)
|
||||||
|
self.assertEqual(msg, body['NeutronError']['message'])
|
||||||
|
|
||||||
def test_router_create_show_no_ext_gwinfo(self):
|
def test_router_create_show_no_ext_gwinfo(self):
|
||||||
name = 'router1'
|
name = 'router1'
|
||||||
tenant_id = _uuid()
|
tenant_id = _uuid()
|
||||||
|
|||||||
Reference in New Issue
Block a user