From 0bba0fe9a4a73b0666bb3221bd5b383fa5606d22 Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Fri, 10 Mar 2017 22:44:12 +0100 Subject: [PATCH] Increase ping timeout, add help command --- vm.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vm.py b/vm.py index 984a666..ab708de 100755 --- a/vm.py +++ b/vm.py @@ -224,7 +224,7 @@ IP: {0.ip} Username: {0.user} Password: {0.password}'''.format(instance)) - subprocess.call(['ping', '-c', '1', instance.ip]) + subprocess.call(['ping', '-c', '1', '-W', '240', instance.ip]) def cmd_iplist(args): @@ -257,12 +257,20 @@ Create missing vMACs for available IPs except: logger.exception('Failed!') +def cmd_help(args): + '''usage: vm help + +ey? +''' + print(__doc__) + return 0 commands = { 'create': cmd_create, 'ip:list': cmd_iplist, 'ip:sync': cmd_ipsync, + 'help': cmd_help, } def main(gargv):