From 9cf732ef9af72fb71e9577e1b5534e9510681343 Mon Sep 17 00:00:00 2001 From: gbenhaim Date: Tue, 25 Apr 2017 00:15:47 +0300 Subject: [PATCH] Print informative message after "lago ovirt start" The message will include the url to the web ui, username and password. Signed-off-by: gbenhaim --- ovirtlago/cmd.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ovirtlago/cmd.py b/ovirtlago/cmd.py index f1a2bb36..0677139c 100755 --- a/ovirtlago/cmd.py +++ b/ovirtlago/cmd.py @@ -21,6 +21,7 @@ import logging import os import sys +import textwrap import warnings import lago @@ -29,6 +30,7 @@ from lago.plugins.cli import CLIPlugin, cli_plugin, cli_plugin_add_argument from lago.utils import in_prefix, with_logging from ovirtlago.prefix import OvirtPrefix, OvirtWorkdir +import ovirtlago.constants as constants LOGGER = logging.getLogger('ovirt-cli') in_ovirt_prefix = in_prefix( @@ -256,6 +258,23 @@ def do_ovirt_start(prefix, with_vms, vms_timeout, **kwargs): with LogTask('Starting Engine VMs'): prefix.virt_env.engine_vm().start_all_vms(timeout=vms_timeout) + LOGGER.info( + textwrap.dedent( + """ + The environment is ready to be used. + You can access the web UI with the following link and credentials: + https://{ip} + Username: {username} + Password: {password} + """.format( + ip=prefix.virt_env.engine_vm().ip(), + username=constants.ENGINE_USER.split('@')[0], + password=prefix.virt_env.engine_vm() + .metadata['ovirt-engine-password'] + ) + ) + ) + @cli_plugin( help=(