commit f9d80651d757ad48ddda16fb96f89237f82f7b3d Author: Jan Tluka jtluka@redhat.com Date: Wed Nov 20 16:01:28 2013 +0100
lnst-ctl: enhance readability of info about processed recipes
Resending version 2 of the patch. I moved the code for generating log entry into a function to avoid code duplication.
This is a patch that would slightly enhance readability of controller log.
First change is addition of a missing log entry when recipes are passed as individual files.
Second change is modification of the log entry so it's obvious that another recipe's being processed.
Before,
Loading config file '/root/lnst/lnst-ctl.conf' Loading config file '/root/.lnst/lnst-ctl.conf' 2013-11-20 09:12:17 (localhost) INFO: Processing recipe file "recipes/team/recipex_ab_001.xml" 2013-11-20 09:12:17 (localhost) INFO: Checking machine pool availability. ...
After,
Loading config file '/root/lnst/lnst-ctl.conf' Loading config file '/root/.lnst/lnst-ctl.conf' 2013-11-20 09:14:43 (localhost) INFO: -------------------------------------------------------- Processing recipe file "recipes/team/recipex_ab_001.xml" -------------------------------------------------------- 2013-11-20 09:14:43 (localhost) INFO: Checking machine pool availability. ...
Signed-off-by: Jan Tluka jtluka@redhat.com Signed-off-by: Jiri Pirko jiri@resnulli.us
lnst-ctl | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) --- diff --git a/lnst-ctl b/lnst-ctl index d597c23..fadeeb8 100755 --- a/lnst-ctl +++ b/lnst-ctl @@ -106,6 +106,12 @@ def get_recipe_result(args, file_path, res_serializer, packet_capture,
return (file_path, res, retval)
+def recipe_head_log_entry(filename) + head_str = "\nProcessing recipe file "%s"\n" % filename + logging.info("-" * len(head_str.strip()) + + head_str + + "-" * len(head_str.strip())) + def main(): """ Main function @@ -213,7 +219,7 @@ def main(): for f in all_files: recipe_file = os.path.join(recipe_path, f) if re.match(r'^.*.xml$', recipe_file): - logging.info("Processing recipe file "%s"" % recipe_file) + recipe_head_log_entry(recipe_file) fp, res, rv = get_recipe_result(action, recipe_file, res_serializer, packet_capture, @@ -221,6 +227,7 @@ def main(): defined_aliases, overriden_aliases) else: + recipe_head_log_entry(recipe_path) fp, res, rv = get_recipe_result(action, recipe_path, res_serializer, packet_capture,
lnst-developers@lists.fedorahosted.org