summaryrefslogtreecommitdiffstats
path: root/bin/ossh_bash_completion
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2016-03-14 15:24:59 -0400
committerKenny Woodson <kwoodson@redhat.com>2016-03-14 15:37:24 -0400
commit8279c9423d1e2166db04c256e3b475583537888b (patch)
tree1f4284abb0e56b85da692b96585e0add9f820cf7 /bin/ossh_bash_completion
parent00ccce6741369f5cffdcca2a9511c57e3aff4b47 (diff)
downloadopenshift-8279c9423d1e2166db04c256e3b475583537888b.tar.gz
openshift-8279c9423d1e2166db04c256e3b475583537888b.tar.bz2
openshift-8279c9423d1e2166db04c256e3b475583537888b.tar.xz
openshift-8279c9423d1e2166db04c256e3b475583537888b.zip
Updating our metadata tooling to work without env
Diffstat (limited to 'bin/ossh_bash_completion')
-rwxr-xr-xbin/ossh_bash_completion6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/ossh_bash_completion b/bin/ossh_bash_completion
index 77b770a43..dcbde3e51 100755
--- a/bin/ossh_bash_completion
+++ b/bin/ossh_bash_completion
@@ -1,12 +1,12 @@
__ossh_known_hosts(){
if python -c 'import openshift_ansible' &>/dev/null; then
- /usr/bin/python -c 'from openshift_ansible import multi_inventory; m=multi_inventory.MultiInventory(); m.run(); z=m.result; print "\n".join(["%s.%s" % (host["oo_name"],host["oo_environment"]) for dns, host in z["_meta"]["hostvars"].items() if all(k in host for k in ("oo_name", "oo_environment"))])'
+ /usr/bin/python -c 'from openshift_ansible import multi_inventory; m=multi_inventory.MultiInventory(); m.run(); z=m.result; print "\n".join([name for name in z["_meta"]["hostvars"].keys()])'
elif [[ -f /dev/shm/.ansible/tmp/multi_inventory.cache ]]; then
- /usr/bin/python -c 'import json; loc="/dev/shm/.ansible/tmp/multi_inventory.cache"; z=json.loads(open(loc).read()); print "\n".join(["%s.%s" % (host["oo_name"],host["oo_environment"]) for dns, host in z["_meta"]["hostvars"].items() if all(k in host for k in ("oo_name", "oo_environment"))])'
+ /usr/bin/python -c 'import json; loc="/dev/shm/.ansible/tmp/multi_inventory.cache"; z=json.loads(open(loc).read()); print "\n".join([name for name in z["_meta"]["hostvars"].keys()])'
elif [[ -f ~/.ansible/tmp/multi_inventory.cache ]]; then
- /usr/bin/python -c 'import json,os; loc="%s" % os.path.expanduser("~/.ansible/tmp/multi_inventory.cache"); z=json.loads(open(loc).read()); print "\n".join(["%s.%s" % (host["oo_name"],host["oo_environment"]) for dns, host in z["_meta"]["hostvars"].items() if all(k in host for k in ("oo_name", "oo_environment"))])'
+ /usr/bin/python -c 'import json,os; loc="%s" % os.path.expanduser("~/.ansible/tmp/multi_inventory.cache"); z=json.loads(open(loc).read()); print "\n".join([name for name in z["_meta"]["hostvars"].keys()])'
fi
}