From 2984109bd5e165aa86ca6728fe3ef6ce0ae666d1 Mon Sep 17 00:00:00 2001 From: gryf Date: Mon, 12 Apr 2021 20:58:32 +0200 Subject: [PATCH] Made a poor-man progress bar for waiting for cloud init. --- box.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/box.py b/box.py index e2549d0..3bce19c 100755 --- a/box.py +++ b/box.py @@ -570,12 +570,14 @@ def vmcreate(args): time.sleep(3) # 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: if vbox.vm_info['uuid'] in vbox.get_running_vms(): + print('.', end='') + sys.stdout.flush() time.sleep(3) else: - print('Done') + print(' done.') break # dettach ISO image vbox.storageattach('IDE', 1, 'dvddrive', 'none') @@ -630,6 +632,7 @@ def main(): parser = argparse.ArgumentParser(description="Automate deployment and " "maintenance of Ubuntu VMs using " "VirtualBox and Ubuntu cloud images") + subparsers = parser.add_subparsers(help='supported commands') create = subparsers.add_parser('create', help='create and configure VM, '