def check_name_format(req, name, target_type):
 if (not name):
  raise HTTPPreconditionFailed(request=req, body=('%s name cannot be empty' % target_type))
 if isinstance(name, six.text_type):
  name = name.encode('utf-8')
 if ('/' in name):
  raise HTTPPreconditionFailed(request=req, body=('%s name cannot contain slashes' % target_type))
 return name

def check_name_format ( req , name , target_type ) : if ( not name ) : raise HTTPPreconditionFailed ( request = req , body = ( '%s name cannot be empty' % target_type ) ) if isinstance ( name , six . text_type ) : name = name . encode ( 'utf-8' ) if ( '/' in name ) : raise HTTPPreconditionFailed ( request = req , body = ( '%s name cannot contain slashes' % target_type ) ) return name
validate that the header contains valid account or container name .