Simplifying call of ansdyninv.py.

This commit is contained in:
Emiliano Vavassori 2016-02-17 15:20:10 +01:00
parent ad5f46793e
commit 752520bc1f
1 changed files with 2 additions and 3 deletions

View File

@ -12,10 +12,9 @@ args=parser.parse_args()
# Simplifying, since we haven't already installed domain.yml, we assume to use
# default gateway IP.
gwt=popen("ip route show | grep ^default")
data=gwt.read()
gwt=popen("ip route show | grep ^default | awk '{ print $3 }'")
srv=gwt.read().strip()
gwt.close()
srv=data.split()[2]
if args.list:
r = requests.get("http://" + srv + ":3000/ansible_list")