<commit_before>import subprocess


def get_external_lb_vip():
    host = subprocess.check_output(["hostname"])
    if "qe-iad3-3" in host:
        h = "qe-iad3-lab03"
    elif "qe-iad3-2" in host:
        h = "qe-iad3-lab02"
    else:
        raise Exception("conf-gen.py is used to configure for iad3-2 and iad3-3.")

    inv = "/opt/rpc-openstack/jenkins-oa/inventory/group_vars/{0}.yml".format(h)
    elva = subprocess.check_output(["grep", "-R", "external_lb_vip_address", inv])
    return elva


def get_password():
    password = subprocess.check_output([
        "grep", "-R", "kibana_password",
        "/etc/openstack_deploy/user_extras_secrets.yml"])
    return password

vip = get_external_lb_vip()
pas = get_password()

f = open('/opt/kibana-selenium/config/app.yaml', 'w')
f.write("kibana:\n")
f.close()
append = open('/opt/kibana-selenium/config/app.yaml', 'a')
append.write("  username: kibana\n")
append.write("  "+pas)
append.write(vip)
append.close()
<commit_msg>one more small change. Added a line to print at the end so there is some returned value<commit_after>import subprocess


def get_external_lb_vip():
    host = subprocess.check_output(["hostname"])
    if "qe-iad3-3" in host:
        h = "qe-iad3-lab03"
    elif "qe-iad3-2" in host:
        h = "qe-iad3-lab02"
    else:
        raise Exception("conf-gen.py is used to configure for iad3-2 and iad3-3.")

    inv = "/opt/rpc-openstack/jenkins-oa/inventory/group_vars/{0}.yml".format(h)
    elva = subprocess.check_output(["grep", "-R", "external_lb_vip_address", inv])
    return elva


def get_password():
    password = subprocess.check_output([
        "grep", "-R", "kibana_password",
        "/etc/openstack_deploy/user_extras_secrets.yml"])
    return password

vip = get_external_lb_vip()
pas = get_password()

f = open('/opt/kibana-selenium/config/app.yaml', 'w')
f.write("kibana:\n")
f.close()
append = open('/opt/kibana-selenium/config/app.yaml', 'a')
append.write("  username: kibana\n")
append.write("  "+pas)
append.write(vip)
append.close()
print "Config file generated into config/app.yaml"
{'fraction_non_alphanumeric': 0.16059443911792906, 'fraction_numerical': 0.014381591562799617, 'mean_word_length': 3.5969162995594712, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4170027', 'n_tokens_mistral': 808, 'n_tokens_neox': 786, 'n_words': 157}