def get_fqdn(repo_url):
 result = None
 if (('@' in repo_url) and ('://' not in repo_url)):
  repo_url = repo_url.split('@', 1)[1]
  if repo_url.startswith('['):
   result = (repo_url.split(']', 1)[0] + ']')
  elif (':' in repo_url):
   result = repo_url.split(':')[0]
  elif ('/' in repo_url):
   result = repo_url.split('/')[0]
 elif ('://' in repo_url):
  parts = urlparse.urlparse(repo_url)
  if (parts[1] != ''):
   result = parts[1]
   if ('@' in result):
    result = result.split('@', 1)[1]
   if result[0].startswith('['):
    result = (result.split(']', 1)[0] + ']')
   elif (':' in result):
    result = result.split(':')[0]
 return result

def get_fqdn ( repo_url ) : result = None if ( ( '@' in repo_url ) and ( '://' not in repo_url ) ) : repo_url = repo_url . split ( '@' , 1 ) [ 1 ] if repo_url . startswith ( '[' ) : result = ( repo_url . split ( ']' , 1 ) [ 0 ] + ']' ) elif ( ':' in repo_url ) : result = repo_url . split ( ':' ) [ 0 ] elif ( '/' in repo_url ) : result = repo_url . split ( '/' ) [ 0 ] elif ( '://' in repo_url ) : parts = urlparse . urlparse ( repo_url ) if ( parts [ 1 ] != '' ) : result = parts [ 1 ] if ( '@' in result ) : result = result . split ( '@' , 1 ) [ 1 ] if result [ 0 ] . startswith ( '[' ) : result = ( result . split ( ']' , 1 ) [ 0 ] + ']' ) elif ( ':' in result ) : result = result . split ( ':' ) [ 0 ] return result
get fully qualified domain name cli example: .