From df375eb8663383e731d786fb03452b8af0739cdd Mon Sep 17 00:00:00 2001 From: Christian Van Wambeke Date: Fri, 1 Jun 2018 15:20:20 +0200 Subject: [PATCH] fix sat compile salome84 --- commands/check.py | 64 +++++++++++++++++++---------------------- commands/clean.py | 17 +++++------ commands/compile.py | 6 ++-- commands/configure.py | 53 ++++++++++++++++++---------------- commands/generate.py | 22 +++++++------- commands/make.py | 42 +++++++++++++-------------- commands/makeinstall.py | 64 +++++++++++++++++++++-------------------- src/compilation.py | 45 ++++++++++++++++------------- src/loggingSat.py | 14 +++++++-- src/salomeTools.py | 28 ++++++++++++++++-- src/utilsSat.py | 6 ++-- 11 files changed, 201 insertions(+), 160 deletions(-) diff --git a/commands/check.py b/commands/check.py index 9bfdc0d..15f5bf5 100644 --- a/commands/check.py +++ b/commands/check.py @@ -80,61 +80,58 @@ Optional: products to configure. # Print some informations msg = _('Executing the check command in the build directories of the application') - logger.info("%s %s\n" % (msg, UTS.label(config.VARS.application))) - - info = [(_("BUILD directory"), - os.path.join(config.APPLICATION.workdir, 'BUILD'))] - UTS.logger_info_tuples(logger, info) + msg = "%s %s" % (msg, UTS.label(config.VARS.application)) + info = [(_("BUILD directory"), os.path.join(config.APPLICATION.workdir, 'BUILD'))] + msg = "\n" + UTS.formatTuples(info) + logger.info(msg) # Call the function that will loop over all the products and execute # the right command(s) - res = check_all_products(config, products_infos, logger) + res = self.check_all_products(products_infos) # Print the final state - nb_products = len(products_infos) - if res == 0: - final_status = "" + good_result = sum(1 for r in res if r.isOk()) + nbExpected = len(products_infos) + msgCount = "(%d/%d)" % (good_result, nbExpected) + if good_result == nbExpected: + status = "OK" + msg = _("command check") + logger.info("\n%s %s: <%s>.\n" % (msg, msgCount, status)) else: - final_status = "" - - logger.info(_("\nCheck: %(status)s (%(1)d/%(2)d)\n") % \ - { 'status': final_status, - '1': nb_products - res, - '2': nb_products }) - - return res + status = "KO" + msg = _("command check, some products have failed") + logger.info("\n%s %s: <%s>.\n" % (msg, msgCount, status)) + + return RCO.ReturnCode(status, "%s %s" % (msg, msgCount)) -def check_all_products(config, products_infos, logger): + def check_all_products(self, products_infos): """ Execute the proper configuration commands in each product build directory. - :param config: (Config) The global configuration :param products_info: (list) List of (str, Config) => (product_name, product_info) - :param logger: (Logger) - The logger instance to use for the display and logging - :return: (int) the number of failing commands. + :return: (list of RCO.ReturnCode) list of OK if it succeed """ - res = 0 + res = [] for p_name_info in products_infos: - res_prod = check_product(p_name_info, config, logger) - if res_prod != 0: - res += 1 + res.append(self.check_product(p_name_info) return res -def check_product(p_name_info, config, logger): + def check_product(self, p_name_info): """ Execute the proper configuration command(s) in the product build directory. :param p_name_info: (tuple) (str, Config) => (product_name, product_info) - :param config: (Config) The global configuration - :param logger: (Logger) - The logger instance to use for the display and logging - :return: (int) 1 if it fails, else 0. + :return: (RCO.ReturnCode) """ + # shortcuts + runner = self.getRunner() + config = self.getConfig() + logger = self.getLogger() + options = self.getOptions() p_name, p_info = p_name_info @@ -170,10 +167,9 @@ is not defined in the definition of %(name)\n""") % p_name if ignored or not cmd_found: UTS.log_step(logger, "ignored") - logger.debug("==== %s %s\n" % (p_name, "IGNORED")) if not cmd_found: - return 1 - return 0 + return RCO.ReturnCode("KO", "command not found product %s" % p_name) + return RCO.ReturnCode("OK", "ignored product %s" % p_name) # Instantiate the class that manages all the construction commands # like cmake, check, make install, make test, environment management, etc... diff --git a/commands/clean.py b/commands/clean.py index f218e1a..095ea1e 100644 --- a/commands/clean.py +++ b/commands/clean.py @@ -135,14 +135,15 @@ The '--properties' options must have the following syntax: return RCO.ReturnCode("KO", "missing option (source/build/install/all) in clean command") # Check with the user if he really wants to suppress the directories - msg = _("Remove the following directories:\n") - for directory in l_dir_to_suppress: - msg += " %s\n" % UTS.info(str(directory)) - if runner.getAnswer(msg[:-1]) == "No": - return RCO.ReturnCode("OK", "user do not want to continue") - - # Suppress the list of paths - suppress_directories(l_dir_to_suppress, logger) + if len(l_dir_to_suppress) > 1: # need one or more + msg = _("Remove the following directories:") + for directory in l_dir_to_suppress: + msg += "\n %s" % UTS.info(str(directory)) + if runner.getAnswer(msg) == "NO": + return RCO.ReturnCode("OK", "user do not want to clean") + # Suppress the list of paths + suppress_directories(l_dir_to_suppress, logger) + return RCO.ReturnCode("OK", "Command clean done") diff --git a/commands/compile.py b/commands/compile.py index d2fbbe9..3d37acd 100644 --- a/commands/compile.py +++ b/commands/compile.py @@ -365,7 +365,7 @@ class Command(_BaseCommand): error_step = "CONFIGURE" msg = _("sat configure problem") logger.error(msg) - return RCO.ReturnCode("KO", "sat configure %s problem" % p_name, (error_step, p_name, p_info.install_dir)) + return RCO.ReturnCode("KO", "sat configure product %s problem" % p_name, (error_step, p_name, p_info.install_dir)) res.append(rc) @@ -402,7 +402,7 @@ class Command(_BaseCommand): logger.error(msg) return RCO.ReturnCode("KO", "sat makeinstall %s problem" % p_name, (error_step, p_name, p_info.install_dir)) - return RCO.ReturnCode("OK", "compile cmake autotools %s done" % p_name) + return RCO.ReturnCode("OK", "compile cmake autotools product %s done" % p_name) def compile_product_script(self, p_name_info): """Execute the script build procedure in the product build directory. @@ -423,7 +423,7 @@ class Command(_BaseCommand): # Logging and sat command call for the script step script_path_display = UTS.label(p_info.compil_script) - UTS.log_step(logger, "SCRIPT %s ..." % script_path_display) + UTS.log_step(logger, "SCRIPT %s" % script_path_display) # res = sat.script(config.VARS.application + " --products " + p_name, verbose = 0, logger_add_link = logger) cmd_args = "--products %s" % p_name diff --git a/commands/configure.py b/commands/configure.py index 9a6e24f..4d776aa 100644 --- a/commands/configure.py +++ b/commands/configure.py @@ -96,42 +96,40 @@ class Command(_BaseCommand): # the right command(s) if options.option is None: options.option = "" - res = configure_all_products(config, products_infos, options.option, logger) + + res = self.configure_all_products(products_infos) - # Print the final state - nb_products = len(products_infos) - if res == 0: - final_status = "" + good_result = sum(1 for r in res if r.isOk()) + nbExpected = len(products_infos) + msgCount = "(%d/%d)" % (good_result, nbExpected) + if good_result == nbExpected: + status = "OK" + msg = _("command configure") + logger.info("\n%s %s: <%s>.\n" % (msg, msgCount, status)) else: - final_status = "" - - logger.info(_("\nConfiguration: %(status)s (%(1)d/%(2)d)\n") % \ - { 'status': final_status, - '1': nb_products - res, - '2': nb_products }, 1) - - return res + status = "KO" + msg = _("command configure, some products have failed") + logger.info("\n%s %s: <%s>.\n" % (msg, msgCount, status)) + + return RCO.ReturnCode(status, "%s %s" % (msg, msgCount)) -def configure_all_products(config, products_infos, conf_option, logger): + + + def configure_all_products(self, products_infos): """ Execute the proper configuration commands in each product build directory. - :param config: (Config) The global configuration :param products_info: (list) List of (str, Config) => (product_name, product_info) - :param conf_option: (str) The options to add to the command - :param logger: (Logger) The logger instance to use for the display and logging - :return: (int) the number of failing commands. - """ - res = 0 + :return: (list of RCO.ReturnCode) list of OK if it succeed + """ + res = [] for p_name_info in products_infos: - res_prod = configure_product(p_name_info, conf_option, config, logger) - if res_prod != 0: - res += 1 + res.append(self.configure_product(p_name_info)) return res -def configure_product(p_name_info, conf_option, config, logger): + def configure_product(self, p_name_info): """ Execute the proper configuration command(s) in the product build directory. @@ -144,7 +142,14 @@ def configure_product(p_name_info, conf_option, config, logger): The logger instance to use for the display and logging :return: (RCO.ReturnCode) """ + # shortcuts + runner = self.getRunner() + config = self.getConfig() + logger = self.getLogger() + options = self.getOptions() + + conf_option = options.option p_name, p_info = p_name_info # Logging diff --git a/commands/generate.py b/commands/generate.py index 1d62199..d1aa646 100644 --- a/commands/generate.py +++ b/commands/generate.py @@ -76,24 +76,24 @@ class Command(_BaseCommand): # Check that the command has been called with an application UTS.check_config_has_application(config).raiseIfKo() - logger.info( _('Generation of SALOME modules for application %s\n') % \ - UTS.label(config.VARS.application) ) + msg = _('Generation of SALOME modules for application %s') % \ + UTS.label(config.VARS.application) + logger.info(msg) status = RCO._KO_STATUS # verify that YACSGEN is available - returnCode = check_yacsgen(config, options.yacsgen, logger) - - if not returnCode.isOk(): - logger.error(returnCode.getWhy()) - return returnCode - else: - yacsgen_dir = returnCode.getValue() + rc = check_yacsgen(config, options.yacsgen, logger) + if not rc.isOk(): + logger.error(rc.getWhy()) + return rc + # ok + yacsgen_dir = rc.getValue() # Make the generator module visible by python sys.path.insert(0, yacsgen_dir) - logger.info(" insert directory PATH %s = %s\n" % \ + logger.info(" insert directory PATH %s = %s" % \ ("YACSGEN", UTS.blue(yacsgen_dir)) ) products = config.APPLICATION.products @@ -135,7 +135,7 @@ class Command(_BaseCommand): logger.error(msg) return RCO.ReturnCode("KO", msg) else: - return RCO.ReturnCode("OK", "generate command done") + return RCO.ReturnCode("OK", "command generate done") def generate_component_list(config, product_info, context, logger): diff --git a/commands/make.py b/commands/make.py index 02e3d6f..dbdd3b2 100644 --- a/commands/make.py +++ b/commands/make.py @@ -79,12 +79,11 @@ class Command(_BaseCommand): products_infos = self.get_products_list(options, config) # Print some informations - logger.info( - _('Executing the make command in the build directories of the application %s\n') % \ - UTS.label(config.VARS.application)) - + msg = _('Executing the make command in the build directories of the application %s') % \ + UTS.label(config.VARS.application) info = [(_("BUILD directory"), os.path.join(config.APPLICATION.workdir, 'BUILD'))] - UTS.logger_info_tuples(logger, info) + msg += "\n" + UTS.formatTuples(info) + logger.info(msg) # Call the function that will loop over all the products and execute # the right command(s) @@ -92,17 +91,19 @@ class Command(_BaseCommand): options.option = "" res = make_all_products(config, products_infos, options.option, logger) - # Print the final state - nb_products = len(products_infos) - if res == 0: - final_status = "OK" + good_result = sum(1 for r in res if r.isOk()) + nbExpected = len(products_infos) + msgCount = "(%d/%d)" % (good_result, nbExpected) + if good_result == nbExpected: + status = "OK" + msg = _("command make") + logger.info("\n%s %s: <%s>.\n" % (msg, msgCount, status)) else: - final_status = "KO" - - msg = _("\nMake: <%s> (%d/%d)\n") % (final_status, nb_products - res, nb_products) - logger.info(msg) - - return RCO.ReturnCode(final_status, msg) + status = "KO" + msg = _("command make, some products have failed") + logger.info("\n%s %s: <%s>.\n" % (msg, msgCount, status)) + + return RCO.ReturnCode(status, "%s %s" % (msg, msgCount)) def make_all_products(config, products_infos, make_option, logger): """ @@ -115,13 +116,11 @@ def make_all_products(config, products_infos, make_option, logger): :param make_option: (str) The options to add to the command :param logger: (Logger) The logger instance to use for the display and logging - :return: (int) the number of failing commands. + :return: (list of RCO.ReturnCode) """ - res = 0 + res = [] for p_name_info in products_infos: - res_prod = make_product(p_name_info, make_option, config, logger) - if res_prod != 0: - res += 1 + res.append(make_product(p_name_info, make_option, config, logger)) return res def make_product(p_name_info, make_option, config, logger): @@ -164,12 +163,13 @@ def make_product(p_name_info, make_option, config, logger): nb_proc, make_opt_without_j = get_nb_proc(p_info, config, make_option) UTS.log_step(logger, "MAKE -j" + str(nb_proc)) + if ARCH.is_windows(): res = builder.wmake(nb_proc, make_opt_without_j) else: res = builder.make(nb_proc, make_opt_without_j) + UTS.log_step(logger, res) - return res def get_nb_proc(product_info, config, make_option): diff --git a/commands/makeinstall.py b/commands/makeinstall.py index 2513e26..a9a7e9c 100644 --- a/commands/makeinstall.py +++ b/commands/makeinstall.py @@ -17,6 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +import os import src.debug as DBG import src.returnCode as RCO @@ -85,40 +86,37 @@ class Command(_BaseCommand): # Call the function that will loop over all the products and execute # the right command(s) - res = makeinstall_all_products(config, products_infos, logger) + res = self.makeinstall_all_products(products_infos) - # Print the final state - nb_products = len(products_infos) - if res == 0: - final_status = "OK" + good_result = sum(1 for r in res if r.isOk()) + nbExpected = len(products_infos) + msgCount = "(%d/%d)" % (good_result, nbExpected) + if good_result == nbExpected: + status = "OK" + msg = _("command makeinstall") + logger.info("\n%s %s: <%s>.\n" % (msg, msgCount, status)) else: - final_status = "KO" - - msg = _("\nMake install: <%s> (%d/%d)\n") % (final_status, nb_products - res, nb_products) - logger.info(msg) - - return RCO.ReturnCode(final_status, msg) + status = "KO" + msg = _("command makeinstall, some products have failed") + logger.info("\n%s %s: <%s>.\n" % (msg, msgCount, status)) + + return RCO.ReturnCode(status, "%s %s" % (msg, msgCount)) -def makeinstall_all_products(config, products_infos, logger): + def makeinstall_all_products(self, products_infos): """ Execute the proper configuration commands in each product build directory. - :param config: (Config) The global configuration :param products_info: (list) List of (str, Config) => (product_name, product_info) - :param logger: (Logger) - The logger instance to use for the display and logging - :return: (int) the number of failing commands. + :return: (list of RCO.ReturnCode) list of OK if it succeed """ - res = 0 + res = [] for p_name_info in products_infos: - res_prod = makeinstall_product(p_name_info, config, logger) - if res_prod != 0: - res += 1 + res.append(self.makeinstall_product(p_name_info)) return res -def makeinstall_product(p_name_info, config, logger): + def makeinstall_product(self, p_name_info): """ Execute the proper configuration command(s) in the product build directory. @@ -128,8 +126,13 @@ def makeinstall_product(p_name_info, config, logger): :param config: (Config) The global configuration :param logger: (Logger) The logger instance to use for the display and logging - :return: (int) 1 if it fails, else 0. + :return: (RCO.ReturnCode) """ + # shortcuts + runner = self.getRunner() + config = self.getConfig() + logger = self.getLogger() + options = self.getOptions() p_name, p_info = p_name_info @@ -141,8 +144,8 @@ def makeinstall_product(p_name_info, config, logger): if ("properties" in p_info and \ "compilation" in p_info.properties and \ p_info.properties.compilation == "no"): - UTS.log_step(logger, "ignored") - return RCO.ReturnCode("OK", "product %s is not compilable" % p_name) + UTS.log_step(logger, "ignored") + return RCO.ReturnCode("OK", "product %s is not compilable" % p_name) # Instantiate the class that manages all the construction commands # like cmake, make, make install, make test, environment management, etc... @@ -150,16 +153,15 @@ def makeinstall_product(p_name_info, config, logger): # Prepare the environment UTS.log_step(logger, "PREPARE ENV") - res_prepare = builder.prepare() - UTS.log_step(logger, res_prepare) + res = builder.prepare() + UTS.log_step(logger, res) # Execute buildconfigure, configure if the product is autotools # Execute cmake if the product is cmake - res = TODO if not PROD.product_has_script(p_info): - UTS.log_step(logger, "MAKE INSTALL") - res_m = builder.install() - UTS.log_step(logger, res_m) - res += res_m + UTS.log_step(logger, "MAKE INSTALL") + res_m = builder.install() + UTS.log_step(logger, res_m) + res += res_m return res diff --git a/src/compilation.py b/src/compilation.py index d45b13d..6d6ce0d 100644 --- a/src/compilation.py +++ b/src/compilation.py @@ -92,11 +92,11 @@ install_dir = %s self.launch_environ.silent = True # no need to show here self.launch_environ.set_full_environ(logger, environ_info) - msg = "build environment:\n" + msg = "build environment" for ee in C_COMPILE_ENV_LIST: vv = self.build_environ.get(ee) if len(vv) > 0: - msg += " %s = %s\n" % (ee, vv) + msg += "\n %s = %s" % (ee, vv) logger.trace(msg) return RCO.ReturnCode("OK", "prepare done") @@ -195,6 +195,7 @@ if test \\"\$(echo \$@ | grep -E '\\\\\\-L/usr/lib(/../lib)?(64)? ')\\" == \\\"\ }\\n\\ CC=\\"hack_libtool\\"%g" libtool''' + # just better but horreur yet hack_cmd=r''' set -x sed -i "s%^CC=\"\(.*\)\"%hack_libtool() { \n\ @@ -243,7 +244,7 @@ make -j %s %s cmd += cmd + " ALL_BUILD.vcxproj" env = self.build_environ.environ.environ - res = UTS.Popen(command, cwd=str(self.build_dir), env=env, logger=logger) + res = UTS.Popen(cmd, cwd=str(self.build_dir), env=env, logger=logger) return res @@ -260,10 +261,10 @@ make -j %s %s cmd = 'make install' env = self.build_environ.environ.environ - res = UTS.Popen(command, cwd=str(self.build_dir), env=env, logger=logger) + res = UTS.Popen(cmd, cwd=str(self.build_dir), env=env, logger=logger) return res - def check(self, command=""): + def check(self, command=None): """Runs 'make_check'.""" logger = self.logger if ARCH.is_windows(): @@ -274,11 +275,11 @@ make -j %s %s else: cmd = 'make test' - if command: + if command is not None: cmd = command env = self.build_environ.environ.environ - res = UTS.Popen(command, cwd=str(self.build_dir), env=env , logger=logger) + res = UTS.Popen(cmd, cwd=str(self.build_dir), env=env, logger=logger) return res @@ -341,26 +342,30 @@ make -j %s %s def do_python_script_build(self, script, nb_proc): """Performs a build with a script.""" + import src.debug as DBG # Easy print stderr (for DEBUG only) logger = self.logger # script found - logger.info(_("Compile %s using script %s\n") % \ - (self.product_info.name, UTS.label(script)) ) + logger.trace(_("Compile %s using script %s\n") % \ + (self.product_info.name, UTS.label(script)) ) + self.nb_proc = nb_proc + # load try: import imp product = self.product_info.name pymodule = imp.load_source(product + "_compile_script", script) + except Exception as e: + msg = "Problem loading compile script\n%s" % script + logger.error(DBG.format_color_exception(msg)) + return RCO.ReturnCode("KO", msg) + # execution + try: self.nb_proc = nb_proc - retcode = pymodule.compil(self.config, self, logger) - except: - __, exceptionValue, exceptionTraceback = sys.exc_info() - logger.error(str(exceptionValue)) - import traceback - traceback.print_tb(exceptionTraceback) - traceback.print_exc() - retcode = 1 - finally: - self.put_txt_log_in_appli_log_dir("script") - return retcode + retcode = pymodule.compil_SAT_51(self.config, self, logger) + return retcode + except Exception as e: + msg = "Problem execution method compil_SAT_51 compile script\n%s" % script + logger.error(DBG.format_color_exception(msg)) + return RCO.ReturnCode("KO", msg) def complete_environment(self, make_options): assert self.build_environ is not None diff --git a/src/loggingSat.py b/src/loggingSat.py index 6a7f5d6..ec5fbc3 100755 --- a/src/loggingSat.py +++ b/src/loggingSat.py @@ -213,6 +213,16 @@ class LoggerSat(LOGI.Logger): self.STEP = _STEP self.TRACE = _TRACE + def getMainCommandHandler(self): + """ + returns handler for colored stdout console/terminal + for human user eye sat outputs + """ + for h in self.handlers: + if h.idCommandHandlers == 0: + return h + return None + def close(self): """ final stuff for logger, done at end salomeTools @@ -303,8 +313,8 @@ class LoggerSat(LOGI.Logger): cmd = config.VARS.command fullNameCmd = cmdInstance.getFullNameStr() hostname = config.VARS.hostname - nameFileXml = "%s_%02i_%s_%s.xml" % (datehour, self.idCommandHandlers, cmd, hostname) - nameFileTxt = "%s_%02i_%s_%s.txt" % (datehour, self.idCommandHandlers, cmd, hostname) + nameFileXml = "%s_%03i_%s_%s.xml" % (datehour, self.idCommandHandlers, cmd, hostname) + nameFileTxt = "%s_%03i_%s_%s.txt" % (datehour, self.idCommandHandlers, cmd, hostname) fileXml = os.path.join(log_dir, nameFileXml) fileTxt = os.path.join(log_dir_out, nameFileTxt) diff --git a/src/salomeTools.py b/src/salomeTools.py index 4a1f530..4c1e404 100755 --- a/src/salomeTools.py +++ b/src/salomeTools.py @@ -256,21 +256,38 @@ class _BaseCommand(object): return cmdInstance def runMicroCommand(self, cmdInstance, cmd_arguments): - """launch a micro command on arguments""" + """ + launch a micro command on arguments, from another command + set this micro command less verbose level as WARNING + to not pollute user main log + """ logger = self.getLogger() commandArguments = self.assumeAsList(cmd_arguments) # Run the micro command using the remainders command arguments strArgs = " ".join(commandArguments) msg = "BEGIN launch micro command %s on (%s)" % (cmdInstance.name, strArgs) logger.step(msg) + + # make micro command less verbose + mainHandler = logger.getMainCommandHandler() + oldLevel = mainHandler.level + mainHandler.setLevel("WARNING") + returnCode = cmdInstance.run(commandArguments) + + # restore verbosity + mainHandler.setLevel(oldLevel) + msg = "END launch micro command %s on (%s)\n%s" % (cmdInstance.name, strArgs, str(returnCode)) - logger.step(msg) + if type(returnCode) != RCO.ReturnCode: + logger.critical(msg) + raise Exception("command %s: ReturnCode type unexpected %s" % (cmdInstance.name, type(returnCode))) + + logger.step(msg) import src.linksXml as LKXML LKXML.setAttribLinkForCommand(cmdInstance, "full_launched_cmd", strArgs) LKXML.setAttribLinkForCommand(cmdInstance, "cmd_res", returnCode.toXmlPassed()) - logger.closeFileHandlerForCommand(cmdInstance) return returnCode @@ -636,6 +653,11 @@ development mode (more verbose error/exception messages) logger.step(msg) returnCode = cmdInstance.run(commandArguments) msg = "END main launch command %s on (%s)\n%s" % (self.nameCommandToLoad, strArgs, str(returnCode)) + + if type(returnCode) != RCO.ReturnCode: + logger.critical(msg) + raise Exception("command %s: ReturnCode type unexpected %s" % (cmdInstance.name, type(returnCode))) + logger.step(msg) import src.linksXml as LKXML diff --git a/src/utilsSat.py b/src/utilsSat.py index a43939c..21e5c5d 100644 --- a/src/utilsSat.py +++ b/src/utilsSat.py @@ -445,18 +445,18 @@ def init_log_step(logger, header, step=""): def log_step(logger, step): header = _log_step_header[-1] if type(step) == str: - logger.info("%s%s ..." % (header, step)) + logger.info("%s %s ..." % (header, step)) return #as ReturnCode type step if step.isOk(): logger.info("%s ..." % header) else: - logger.info("%s%s ..." % (header, step.getwhy())) + logger.info("%s%s ..." % (header, step.getWhy())) def end_log_step(logger, step): header = _log_step_header[-1] if type(step) == str: - logger.info("%s%s" % (header, step)) + logger.info("%s %s" % (header, step)) if len(_log_step_header) > 1: _log_step_header.pop() return #as ReturnCode type -- 2.39.2