From 9e09fd38a7ce115eb699b9f8d031cb57df25d9a6 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Tue, 17 Jan 2017 09:55:40 -0500 Subject: [PATCH] Properly parse subversion revision info. The ansible subversion module returns revision info in an unanticipated format: https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/source_control/subversion.py#L194-L199 Parse out the revision number we actually care about. Resolves #4654 --- awx/playbooks/project_update.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/awx/playbooks/project_update.yml b/awx/playbooks/project_update.yml index 30eff5f6bc..0f4d354ff7 100644 --- a/awx/playbooks/project_update.yml +++ b/awx/playbooks/project_update.yml @@ -115,6 +115,12 @@ chdir: "{{project_path|quote}}/roles" when: doesRequirementsExist.stat.exists and scm_full_checkout|bool + # format provided by ansible is ["Revision: 12345", "URL: ..."] + - name: parse subversion version string properly + set_fact: + scm_version: "{{scm_version|regex_replace('^.*Revision: ([0-9]+).*$', '\\1')}}" + when: scm_type == 'svn' + - name: Repository Version debug: msg="Repository Version {{ scm_version }}" when: scm_version is defined