← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1533518] [NEW] Remove 'validate' key in 'type:dict_or_nodata' type in resource attribute map

 

Public bug reported:

In neutron/extensions/l3_ext_gw_mode.py, there's another 'validate' key in the 'validate' section of type 'type:dict_or_nodata', this cause the validation is not performed.
Because in _validate_dict_item(), it checks key name that starts with 'type:', and perform the validation.

EXTENDED_ATTRIBUTES_2_0 = { 
    'routers': {l3.EXTERNAL_GW_INFO:
                {'allow_post': True,
                 'allow_put': True,
                 'is_visible': True,
                 'default': None,
                 'enforce_policy': True,
                 'validate':
                 {'type:dict_or_nodata':
                  {'network_id': {'type:uuid': None, 'required': True},
                   'enable_snat': {'type:boolean': None, 'required': False,
                                   'convert_to': attrs.convert_to_boolean},
                   'external_fixed_ips': {
                       'convert_list_to': attrs.convert_kvp_list_to_dict,
                       'validate': {'type:fixed_ips': None},                                        <======== error
                       'default': None,
                       'required': False}
                   }   
                  }}}}

The correct format is :

'external_fixed_ips': {
                       'convert_list_to': attrs.convert_kvp_list_to_dict,
                       'type:fixed_ips': None,                                        <======== should be
                       'default': None,
                       'required': False}
                   }

** Affects: neutron
     Importance: Undecided
     Assignee: Bo Chi (bochi-michael)
         Status: In Progress

** Changed in: neutron
     Assignee: (unassigned) => Bo Chi (bochi-michael)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1533518

Title:
  Remove 'validate' key in 'type:dict_or_nodata' type in resource
  attribute map

Status in neutron:
  In Progress

Bug description:
  In neutron/extensions/l3_ext_gw_mode.py, there's another 'validate' key in the 'validate' section of type 'type:dict_or_nodata', this cause the validation is not performed.
  Because in _validate_dict_item(), it checks key name that starts with 'type:', and perform the validation.

  EXTENDED_ATTRIBUTES_2_0 = { 
      'routers': {l3.EXTERNAL_GW_INFO:
                  {'allow_post': True,
                   'allow_put': True,
                   'is_visible': True,
                   'default': None,
                   'enforce_policy': True,
                   'validate':
                   {'type:dict_or_nodata':
                    {'network_id': {'type:uuid': None, 'required': True},
                     'enable_snat': {'type:boolean': None, 'required': False,
                                     'convert_to': attrs.convert_to_boolean},
                     'external_fixed_ips': {
                         'convert_list_to': attrs.convert_kvp_list_to_dict,
                         'validate': {'type:fixed_ips': None},                                        <======== error
                         'default': None,
                         'required': False}
                     }   
                    }}}}

  The correct format is :

  'external_fixed_ips': {
                         'convert_list_to': attrs.convert_kvp_list_to_dict,
                         'type:fixed_ips': None,                                        <======== should be
                         'default': None,
                         'required': False}
                     }

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1533518/+subscriptions


Follow ups