def validate_dictionary_string_length(specs):
 if (not isinstance(specs, dict)):
  msg = _('specs must be a dictionary.')
  raise exception.InvalidInput(reason=msg)
 for (key, value) in specs.items():
  if (key is not None):
   check_string_length(key, ('Key "%s"' % key), min_length=1, max_length=255)
  if (value is not None):
   check_string_length(value, ('Value for key "%s"' % key), min_length=0, max_length=255)

def validate_dictionary_string_length ( specs ) : if ( not isinstance ( specs , dict ) ) : msg = _ ( 'specs must be a dictionary.' ) raise exception . InvalidInput ( reason = msg ) for ( key , value ) in specs . items ( ) : if ( key is not None ) : check_string_length ( key , ( 'Key "%s"' % key ) , min_length = 1 , max_length = 255 ) if ( value is not None ) : check_string_length ( value , ( 'Value for key "%s"' % key ) , min_length = 0 , max_length = 255 )
check the length of each key and value of dictionary .