From 3a70affb9aa8ff78f3ff33fc21d1095fdc1b911d Mon Sep 17 00:00:00 2001 From: joefis Date: Mon, 30 Mar 2015 16:39:09 +0100 Subject: [PATCH] Vagrant inventory: exit 0 on success Current code has sys.exit(1) at the end of the codepath for the options --help, --list and --host. These are not error conditions so should be returning 0 for success, not 1 which is EPERM i.e. "Operation not permitted". Newer Vagrant versions examine the exit codes from subprocesses and interpret this as a failure. --- plugins/inventory/vagrant.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/inventory/vagrant.py b/plugins/inventory/vagrant.py index ea59a7bc02..7f6dc925e8 100755 --- a/plugins/inventory/vagrant.py +++ b/plugins/inventory/vagrant.py @@ -107,7 +107,7 @@ if options.list: hosts['vagrant'].append(data['HostName']) print json.dumps(hosts) - sys.exit(1) + sys.exit(0) # Get out the host details #------------------------------ @@ -122,11 +122,11 @@ elif options.host: result['ansible_ssh_port'] = result['Port'] print json.dumps(result) - sys.exit(1) + sys.exit(0) # Print out help #------------------------------ else: parser.print_help() - sys.exit(1) \ No newline at end of file + sys.exit(0)