diff options
author | Jamie Evans <github@pixelrebel.com> | 2016-10-18 11:33:51 -0700 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2016-10-18 11:33:51 -0700 |
commit | b59b5d36e0d770d88787b90d12dea35fbda70b4f (patch) | |
tree | 9e52ffa66245211c4a58c976fbd3c37003f46ce5 | |
parent | ecc40297537e7cf3912710011a09529fa8b53560 (diff) | |
download | ansible-modules-core-b59b5d36e0d770d88787b90d12dea35fbda70b4f.tar.gz |
verify both tags and commits (#2654)
This fixes a bug where the module fails to verify tags. I added a conditional statement in `verify_commit_sign()` that checks if `version` argument is a tag, if so, use `git verify-tag` instead.
-rw-r--r-- | source_control/git.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source_control/git.py b/source_control/git.py index 1060ab91..41c29a4c 100644 --- a/source_control/git.py +++ b/source_control/git.py @@ -786,7 +786,11 @@ def switch_version(git_path, module, dest, remote, version, verify_commit, depth def verify_commit_sign(git_path, module, dest, version): - cmd = "%s verify-commit %s" % (git_path, version) + if version in get_tags(git_path, module, dest): + git_sub = "verify-tag" + else: + git_sub = "verify-commit" + cmd = "%s %s %s" % (git_path, git_sub, version) (rc, out, err) = module.run_command(cmd, cwd=dest) if rc != 0: module.fail_json(msg='Failed to verify GPG signature of commit/tag "%s"' % version, stdout=out, stderr=err, rc=rc) |