diff --git a/sw-patch/cgcs-patch/cgcs_patch/patch_client.py b/sw-patch/cgcs-patch/cgcs_patch/patch_client.py index 7bcbc518..41bd9331 100644 --- a/sw-patch/cgcs-patch/cgcs_patch/patch_client.py +++ b/sw-patch/cgcs-patch/cgcs_patch/patch_client.py @@ -302,6 +302,7 @@ def print_patch_show_result(req): if 'metadata' in data: pd = data['metadata'] + contents = data['contents'] for patch_id in sorted(list(pd)): print("%s:" % patch_id) @@ -375,9 +376,21 @@ def print_patch_show_result(req): print(' ' * 20 + req_patch) if "contents" in data and patch_id in data["contents"]: - print(" Contents:") - for pkg in sorted(data["contents"][patch_id]): - print(' ' * 20 + pkg) + print(" Contents:\n") + if "number_of_commits" in contents[patch_id] and \ + contents[patch_id]["number_of_commits"] != "": + print(textwrap.fill(" {0:<15} ".format("No. of commits:") + + contents[patch_id]["number_of_commits"], + width=TERM_WIDTH, subsequent_indent=' ' * 20)) + if "base" in contents[patch_id] and \ + contents[patch_id]["base"]["commit"] != "": + print(textwrap.fill(" {0:<15} ".format("Base commit:") + + contents[patch_id]["base"]["commit"], + width=TERM_WIDTH, subsequent_indent=' ' * 20)) + for i in range(int(contents[patch_id]["number_of_commits"])): + print(textwrap.fill(" {0:<15} ".format("Commit%s:" % (i + 1)) + + contents[patch_id]["commit%s" % (i + 1)]["commit"], + width=TERM_WIDTH, subsequent_indent=' ' * 20)) print("\n") diff --git a/sw-patch/cgcs-patch/cgcs_patch/patch_controller.py b/sw-patch/cgcs-patch/cgcs_patch/patch_controller.py index 63b1e75b..bc6753a4 100644 --- a/sw-patch/cgcs-patch/cgcs_patch/patch_controller.py +++ b/sw-patch/cgcs-patch/cgcs_patch/patch_controller.py @@ -1049,8 +1049,11 @@ class PatchController(PatchService): LOG.exception("Failure during commit consistency check for %s.", patch_id) if self.patch_data.contents[patch_id]["base"]["commit"] != latest_commit: - msg = "The base commit for %s do not match the latest commit " \ - "on this system." % (patch_id) + msg = "The base commit %s for %s does not match the latest commit %s" \ + "on this system." \ + % (self.patch_data.contents[patch_id]["base"]["commit"], + patch_id, + latest_commit) LOG.info(msg) msg_info += msg + "\n" continue