def check_metadata_properties(metadata=None):
 if (not metadata):
  metadata = {}
 for (k, v) in metadata.items():
  if (len(k) == 0):
   msg = _('Metadata property key blank.')
   LOG.debug(msg)
   raise exception.InvalidVolumeMetadata(reason=msg)
  if (len(k) > 255):
   msg = (_('Metadata property key %s greater than 255 characters.') % k)
   LOG.debug(msg)
   raise exception.InvalidVolumeMetadataSize(reason=msg)
  if (len(v) > 255):
   msg = (_('Metadata property key %s value greater than 255 characters.') % k)
   LOG.debug(msg)
   raise exception.InvalidVolumeMetadataSize(reason=msg)

def check_metadata_properties ( metadata = None ) : if ( not metadata ) : metadata = { } for ( k , v ) in metadata . items ( ) : if ( len ( k ) == 0 ) : msg = _ ( 'Metadata property key blank.' ) LOG . debug ( msg ) raise exception . InvalidVolumeMetadata ( reason = msg ) if ( len ( k ) > 255 ) : msg = ( _ ( 'Metadata property key %s greater than 255 characters.' ) % k ) LOG . debug ( msg ) raise exception . InvalidVolumeMetadataSize ( reason = msg ) if ( len ( v ) > 255 ) : msg = ( _ ( 'Metadata property key %s value greater than 255 characters.' ) % k ) LOG . debug ( msg ) raise exception . InvalidVolumeMetadataSize ( reason = msg )
checks that the volume metadata properties are valid .