예제 #1
0
 def get_devices(self, context, filters=None, fields=None):
     devices = self._get_collection(context,
                                    Device,
                                    self._make_device_dict,
                                    filters=filters,
                                    fields=fields)
     # Ugly hack to mask internaly used record
     return [
         device for device in devices
         if uuidutils.is_uuid_like(device['id'])
     ]
예제 #2
0
파일: attributes.py 프로젝트: liujyg/tacker
def _validate_uuid(data, valid_values=None):
    if not uuidutils.is_uuid_like(data):
        msg = _("'%s' is not a valid UUID") % data
        LOG.debug(msg)
        return msg
예제 #3
0
 def get_devices(self, context, filters=None, fields=None):
     devices = self._get_collection(context, Device, self._make_device_dict,
                                    filters=filters, fields=fields)
     # Ugly hack to mask internaly used record
     return [device for device in devices
             if uuidutils.is_uuid_like(device['id'])]
예제 #4
0
def _validate_uuid(data, valid_values=None):
    if not uuidutils.is_uuid_like(data):
        msg = _("'%s' is not a valid UUID") % data
        LOG.debug(msg)
        return msg