From 9b354904496c460bb7688ef35a97f593deb7ac8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Wed, 6 Mar 2019 17:59:55 +0100 Subject: [PATCH] More explicit env generation logging --- CHANGELOG.md | 1 + tutor/android.py | 1 - tutor/env.py | 4 ++++ tutor/images.py | 1 - tutor/k8s.py | 1 - tutor/local.py | 1 - 6 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66cade5..ea0766e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Latest +- [Improvement] More explicit logging during environment generation - [Improvement] Configurable docker images (#122) - [Bugfix] Fix "android pullimage" command - [Improvement] Do not upgrade images as part of quickstart diff --git a/tutor/android.py b/tutor/android.py index 47bc056..d3fed61 100644 --- a/tutor/android.py +++ b/tutor/android.py @@ -23,7 +23,6 @@ def env(root): config["LMS_HOST_REVERSE"] = ".".join(config["LMS_HOST"].split(".")[::-1]) tutor_env.render_target(root, config, "build") tutor_env.render_target(root, config, "android") - click.echo(fmt.info("Environment generated in {}".format(root))) @click.group( help="Build the application" diff --git a/tutor/env.py b/tutor/env.py index d56bfda..b96fde6 100644 --- a/tutor/env.py +++ b/tutor/env.py @@ -2,9 +2,11 @@ import codecs import os import shutil +import click import jinja2 from . import exceptions +from . import fmt from . import utils @@ -21,6 +23,7 @@ def render_target(root, config, target): substituted = render_str(fi.read(), config) with open(dst, "w") as of: of.write(substituted) + click.echo(fmt.info("Environment generated in {}".format(pathjoin(root, target)))) def render_dict(config): """ @@ -67,6 +70,7 @@ def copy_target(root, target): for src, dst in walk_templates(root, target): if is_part_of_env(src): shutil.copy(src, dst) + click.echo(fmt.info("Environment generated in {}".format(pathjoin(root, target)))) def is_part_of_env(path): return not os.path.basename(path).startswith(".") diff --git a/tutor/images.py b/tutor/images.py index 5e59bb7..f2753ac 100644 --- a/tutor/images.py +++ b/tutor/images.py @@ -23,7 +23,6 @@ argument_image = click.argument( @opts.root def env(root): tutor_env.copy_target(root, "build") - click.echo(fmt.info("Environment generated in {}".format(root))) @click.command( short_help="Download docker images", diff --git a/tutor/k8s.py b/tutor/k8s.py index 10bc6bc..3794df4 100644 --- a/tutor/k8s.py +++ b/tutor/k8s.py @@ -39,7 +39,6 @@ def env(root): config = tutor_config.load(root) tutor_env.render_target(root, config, "apps") tutor_env.render_target(root, config, "k8s") - click.echo(fmt.info("Environment generated in {}".format(root))) @click.command(help="Run all configured Open edX services") @opts.root diff --git a/tutor/local.py b/tutor/local.py index e3b9862..25c7bd1 100644 --- a/tutor/local.py +++ b/tutor/local.py @@ -51,7 +51,6 @@ def env(root): config = tutor_config.load(root) tutor_env.render_target(root, config, "apps") tutor_env.render_target(root, config, "local") - click.echo(fmt.info("Environment generated in {}".format(root))) @click.command( help="Update docker images",