Skip to content

Commit

Permalink
Merge pull request #19 from chornberger-c2c/chr_patch_4
Browse files Browse the repository at this point in the history
chore: make functions cleaner
  • Loading branch information
chornberger-c2c authored Feb 29, 2024
2 parents 88abb54 + 8190cb4 commit a5bb306
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions vagrant_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def main():
('port', 'ansible_port')]

parse_options()
process_options()

def parse_options():
"""
Expand All @@ -58,20 +57,11 @@ def parse_options():
help="Produce a JSON consumable grouping of Vagrant servers for Ansible")
parser.add_argument('--host', default=None, dest="host",
help="Generate additional host specific details for given host for Ansible")
global options
options = parser.parse_args()

global help
help = parser

global mapping
mapping = {}

def process_options():
"""
List out servers that vagrant has running or print host details
"""

if options.list:
list_running_boxes()
ssh_config = get_ssh_config()
Expand All @@ -90,7 +80,7 @@ def process_options():
sys.exit(0)

else:
help.print_help()
parser.print_help()
sys.exit(0)

def list_running_boxes():
Expand Down

0 comments on commit a5bb306

Please sign in to comment.