summaryrefslogtreecommitdiff
path: root/virt-install
diff options
context:
space:
mode:
authorAthina Plaskasoviti <athina.plaskasoviti@gmail.com>2019-08-14 12:16:00 +0300
committerCole Robinson <crobinso@redhat.com>2019-11-20 16:41:10 -0500
commit7ae6a600862d773333a013c757aa8c23bc05c75c (patch)
tree9d5623d88c3037085f319498619e3922bf855e7a /virt-install
parentb4daeba6b50505f5d511bf7915d407f5db3499c6 (diff)
downloadvirt-manager-7ae6a600862d773333a013c757aa8c23bc05c75c.tar.gz
cloudinit: Move random password printing and sleeping to virt-install
Fixed: - Added a do_log flag to print_stdout(), to avoid logging of printed random password. - Excluded timeout in virt-install from testing Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
Diffstat (limited to 'virt-install')
-rwxr-xr-xvirt-install10
1 files changed, 10 insertions, 0 deletions
diff --git a/virt-install b/virt-install
index bf5219a4..2a6f58c7 100755
--- a/virt-install
+++ b/virt-install
@@ -9,6 +9,7 @@ import argparse
import atexit
import sys
import time
+import select
import libvirt
@@ -677,6 +678,15 @@ def start_install(guest, installer, options):
if options.destroy_on_exit:
atexit.register(_destroy_on_exit, domain)
+ passwd = installer.get_generated_password()
+ if options.cloud_init and passwd: # pragma: no cover
+ print_stdout(_("Password for first login is: %s") % passwd, do_log=False)
+ print_stdout(
+ _("Installation will continue in 10 seconds "
+ "(press Enter to skip)"))
+ timeout = 10
+ select.select([sys.stdin], [], [], timeout)
+
cli.connect_console(guest, domain, conscb,
waithandler.wait_for_console_to_exit,
options.destroy_on_exit)