mirror of
https://github.com/gryf/boxpy.git
synced 2025-12-20 14:17:57 +01:00
Made a poor-man progress bar for waiting for cloud init.
This commit is contained in:
7
box.py
7
box.py
@@ -570,12 +570,14 @@ def vmcreate(args):
|
|||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
|
|
||||||
# than, let's try to see if boostraping process has finished
|
# than, let's try to see if boostraping process has finished
|
||||||
print('Waiting for cloud init to finish')
|
print('Waiting for cloud init to finish ', end='')
|
||||||
while True:
|
while True:
|
||||||
if vbox.vm_info['uuid'] in vbox.get_running_vms():
|
if vbox.vm_info['uuid'] in vbox.get_running_vms():
|
||||||
|
print('.', end='')
|
||||||
|
sys.stdout.flush()
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
else:
|
else:
|
||||||
print('Done')
|
print(' done.')
|
||||||
break
|
break
|
||||||
# dettach ISO image
|
# dettach ISO image
|
||||||
vbox.storageattach('IDE', 1, 'dvddrive', 'none')
|
vbox.storageattach('IDE', 1, 'dvddrive', 'none')
|
||||||
@@ -630,6 +632,7 @@ def main():
|
|||||||
parser = argparse.ArgumentParser(description="Automate deployment and "
|
parser = argparse.ArgumentParser(description="Automate deployment and "
|
||||||
"maintenance of Ubuntu VMs using "
|
"maintenance of Ubuntu VMs using "
|
||||||
"VirtualBox and Ubuntu cloud images")
|
"VirtualBox and Ubuntu cloud images")
|
||||||
|
|
||||||
subparsers = parser.add_subparsers(help='supported commands')
|
subparsers = parser.add_subparsers(help='supported commands')
|
||||||
|
|
||||||
create = subparsers.add_parser('create', help='create and configure VM, '
|
create = subparsers.add_parser('create', help='create and configure VM, '
|
||||||
|
|||||||
Reference in New Issue
Block a user