def extract_domain(var_name, output):
var = getenv(var_name)<EOL>if var:<EOL><INDENT>p = urlparse(var)<EOL>output.append(p.hostname)<EOL><DEDENT>
Extracts just the domain name from an URL and adds it to a list