Commit 546e6996 authored by Noe Nieto's avatar Noe Nieto 💬

rename function

parent ee75ea30
......@@ -108,7 +108,7 @@ def create_box(hostname, ram, cpus):
@only_if_box_exist
def destroy_box(hostname):
def destroy_vm(hostname):
"""
Destroy a box, or all
"""
......@@ -136,7 +136,7 @@ def start_vm(hostname):
@only_if_box_exist
def halt(hostname):
def halt_vm(hostname):
"""
Stops the vm with the provided hostname
"""
......@@ -174,6 +174,7 @@ COMMANDS = {
'status': "Prints the status of all the VM's managed by shipyard",
'create': 'Creates a new VM using vagrant and libvirt (KVM)',
'up': 'Start VM',
'halt': 'Stop/shutdown a VM',
'destroy': 'Destroy the VM and do cleanup',
'ssh': 'Connect to the vm using SSH',
'playbook': 'Run a playbook against a machine',
......@@ -216,8 +217,10 @@ if __name__ == '__main__':
sub_args = sub_parser.parse_args(sys.argv[2:])
if cmd_args.command == 'up':
start_vm(sub_args.hostname)
if cmd_args.command == 'halt':
halt_vm(sub_args.hostname)
elif cmd_args.command == 'destroy':
destroy_box(sub_args.hostname)
destroy_vm(sub_args.hostname)
elif cmd_args.command == 'ssh':
invoke_shell(sub_args.hostname)
elif cmd_args.command == 'which':
......
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