def _validate_device_list(data, valid_values=None):
 if (not data):
  msg = _('Cannot create a gateway with an empty device list')
  return msg
 try:
  for device in data:
   err_msg = attributes._validate_dict(device, key_specs={DEVICE_ID_ATTR: {'type:regex': attributes.UUID_PATTERN, 'required': True}, IFACE_NAME_ATTR: {'type:string': None, 'required': False}})
   if err_msg:
    return err_msg
 except TypeError:
  return (_('%s: provided data are not iterable') % _validate_device_list.__name__)

def _validate_device_list ( data , valid_values = None ) : if ( not data ) : msg = _ ( 'Cannot create a gateway with an empty device list' ) return msg try : for device in data : err_msg = attributes . _validate_dict ( device , key_specs = { DEVICE_ID_ATTR : { 'type:regex' : attributes . UUID_PATTERN , 'required' : True } , IFACE_NAME_ATTR : { 'type:string' : None , 'required' : False } } ) if err_msg : return err_msg except TypeError : return ( _ ( '%s: provided data are not iterable' ) % _validate_device_list . __name__ )
validate the list of service definitions .