From 96ac9bcb7587e9946e7cbd94e4d07302a6776378 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 25 Oct 2022 21:03:30 +0000 Subject: [PATCH] Add additional detail in commit --- bootstrap-daemon/pvcbootstrapd/lib/ansible.py | 2 +- bootstrap-daemon/pvcbootstrapd/lib/git.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bootstrap-daemon/pvcbootstrapd/lib/ansible.py b/bootstrap-daemon/pvcbootstrapd/lib/ansible.py index aae2d36..d8947b4 100755 --- a/bootstrap-daemon/pvcbootstrapd/lib/ansible.py +++ b/bootstrap-daemon/pvcbootstrapd/lib/ansible.py @@ -76,7 +76,7 @@ def run_bootstrap(config, cspec, cluster, nodes): logger.info("{}: {}".format(r.status, r.rc)) logger.info(r.stats) if r.rc == 0: - git.commit_repository(config) + git.commit_repository(config, f"Generated files for cluster '{cluster.name}'") git.push_repository(config) notifications.send_webhook(config, "success", f"Cluster {cluster.name}: Completed Ansible bootstrap") else: diff --git a/bootstrap-daemon/pvcbootstrapd/lib/git.py b/bootstrap-daemon/pvcbootstrapd/lib/git.py index eece9a3..6d1fd80 100755 --- a/bootstrap-daemon/pvcbootstrapd/lib/git.py +++ b/bootstrap-daemon/pvcbootstrapd/lib/git.py @@ -76,7 +76,7 @@ def pull_repository(config): logger.info("Completed repository synchonization") -def commit_repository(config): +def commit_repository(config, message="Generic commit"): """ Commit uncommitted changes to the Ansible git repository """ @@ -94,6 +94,8 @@ def commit_repository(config): g.commit( "-m", "Automated commit from PVC Bootstrap Ansible subsystem", + "-m", + message, author="PVC Bootstrap ", env=commit_env, )