def oo_hostname_from_url(url):
 if (not isinstance(url, string_types)):
  raise errors.AnsibleFilterError('|failed expects a string or unicode')
 parse_result = urlparse(url)
 if (parse_result.netloc != ''):
  return parse_result.netloc
 else:
  return parse_result.path

def oo_hostname_from_url ( url ) : if ( not isinstance ( url , string_types ) ) : raise errors . AnsibleFilterError ( '|failed expects a string or unicode' ) parse_result = urlparse ( url ) if ( parse_result . netloc != '' ) : return parse_result . netloc else : return parse_result . path
returns the hostname contained in a url ex: URL -> ose3-master .