def parse_nms_url(url):
 pr = urlparse.urlparse(url)
 scheme = pr.scheme
 auto = (scheme == 'auto')
 if auto:
  scheme = 'http'
 user = 'admin'
 password = 'nexenta'
 if ('@' not in pr.netloc):
  host_and_port = pr.netloc
 else:
  (user_and_password, host_and_port) = pr.netloc.split('@', 1)
  if (':' in user_and_password):
   (user, password) = user_and_password.split(':')
  else:
   user = user_and_password
 if (':' in host_and_port):
  (host, port) = host_and_port.split(':', 1)
 else:
  (host, port) = (host_and_port, '2000')
 return (auto, scheme, user, password, host, port, '/rest/nms/')

def parse_nms_url ( url ) : pr = urlparse . urlparse ( url ) scheme = pr . scheme auto = ( scheme == 'auto' ) if auto : scheme = 'http' user = 'admin' password = 'nexenta' if ( '@' not in pr . netloc ) : host_and_port = pr . netloc else : ( user_and_password , host_and_port ) = pr . netloc . split ( '@' , 1 ) if ( ':' in user_and_password ) : ( user , password ) = user_and_password . split ( ':' ) else : user = user_and_password if ( ':' in host_and_port ) : ( host , port ) = host_and_port . split ( ':' , 1 ) else : ( host , port ) = ( host_and_port , '2000' ) return ( auto , scheme , user , password , host , port , '/rest/nms/' )
parse nms url into normalized parts like scheme .