Commit 3a70affb by joefis

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.
parent 1ae5b929
...@@ -107,7 +107,7 @@ if options.list: ...@@ -107,7 +107,7 @@ if options.list:
hosts['vagrant'].append(data['HostName']) hosts['vagrant'].append(data['HostName'])
print json.dumps(hosts) print json.dumps(hosts)
sys.exit(1) sys.exit(0)
# Get out the host details # Get out the host details
#------------------------------ #------------------------------
...@@ -122,11 +122,11 @@ elif options.host: ...@@ -122,11 +122,11 @@ elif options.host:
result['ansible_ssh_port'] = result['Port'] result['ansible_ssh_port'] = result['Port']
print json.dumps(result) print json.dumps(result)
sys.exit(1) sys.exit(0)
# Print out help # Print out help
#------------------------------ #------------------------------
else: else:
parser.print_help() parser.print_help()
sys.exit(1) sys.exit(0)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment