summaryrefslogtreecommitdiffstats
path: root/bin/ossh_zsh_completion
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2016-03-14 15:41:24 -0400
committerKenny Woodson <kwoodson@redhat.com>2016-03-14 15:41:24 -0400
commit4c6290bba977fea444c1758d74610c9dbf73be4e (patch)
tree65f9bdd49f44ef6a242144214e996ff6c72a8950 /bin/ossh_zsh_completion
parentf4687e333679748341326e8d2fff38a8c93a7606 (diff)
parent8279c9423d1e2166db04c256e3b475583537888b (diff)
downloadopenshift-4c6290bba977fea444c1758d74610c9dbf73be4e.tar.gz
openshift-4c6290bba977fea444c1758d74610c9dbf73be4e.tar.bz2
openshift-4c6290bba977fea444c1758d74610c9dbf73be4e.tar.xz
openshift-4c6290bba977fea444c1758d74610c9dbf73be4e.zip
Merge pull request #1598 from kwoodson/metafix
Updates for metadata tooling to work without env.
Diffstat (limited to 'bin/ossh_zsh_completion')
-rw-r--r--bin/ossh_zsh_completion6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/ossh_zsh_completion b/bin/ossh_zsh_completion
index 170ca889b..94ea61dab 100644
--- a/bin/ossh_zsh_completion
+++ b/bin/ossh_zsh_completion
@@ -2,13 +2,13 @@
_ossh_known_hosts(){
if python -c 'import openshift_ansible' &>/dev/null; then
- print $(/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"))])')
+ print $(/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
- print $(/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"))])')
+ print $(/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
- print $(/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"))])')
+ print $(/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