forked from uncloud/uncloud
28 lines
813 B
Python
28 lines
813 B
Python
import argparse
|
|
|
|
from uncloud.hack.vm import VM
|
|
from uncloud.hack.config import Config
|
|
from uncloud.hack.mac import MAC
|
|
|
|
arg_parser = argparse.ArgumentParser('hack', add_help=False)
|
|
#description="Commands that are unfinished - use at own risk")
|
|
arg_parser.add_argument('--create-vm', action='store_true')
|
|
arg_parser.add_argument('--last-used-mac', action='store_true')
|
|
arg_parser.add_argument('--get-new-mac', action='store_true')
|
|
|
|
|
|
def main(arguments):
|
|
print(arguments)
|
|
config = Config(arguments)
|
|
|
|
if arguments['create_vm']:
|
|
print("Creating VM")
|
|
vm = VM(config)
|
|
vm.create()
|
|
|
|
if arguments['last_used_mac']:
|
|
m = MAC(config)
|
|
print(m.last_used_mac())
|
|
|
|
if arguments['get_new_mac']:
|
|
print(MAC(config).get_next())
|