diff --git a/vagrant_inventory.py b/vagrant_inventory.py index 5b2144d..57a0c9d 100755 --- a/vagrant_inventory.py +++ b/vagrant_inventory.py @@ -44,10 +44,10 @@ def main(): ('hostname', 'ansible_host'), ('identityfile', 'ansible_private_key_file'), ('port', 'ansible_port')] - + parse_options() process_options() - + def parse_options(): """ Parse command line options @@ -82,7 +82,7 @@ def process_options(): print(json.dumps({_GROUP: list(mapping.values()), '_meta': meta}, indent=4)) sys.exit(0) - + elif options.host: list_running_boxes() host_id = list(mapping.keys())[list(mapping.values()).index(options.host)] @@ -149,4 +149,4 @@ def get_a_ssh_config(box_id,box_name): return dict((v, host_config[k]) for k, v in _ssh_to_ansible) if __name__ == "__main__": - main() \ No newline at end of file + main()