From a4ebb1c463e3f054b59f1d0189529ff388366011 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sun, 15 Oct 2017 08:57:20 -0500 Subject: [PATCH] Move chdir into script itself chdir for script commands isn't added until ansible 2.4 which we don't run yet. Change-Id: I4e042979a7bea3fa87d7cffb12e6728a8357dc9f --- playbooks/files/project-requirements-change.py | 2 ++ playbooks/requirements-check.yaml | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/files/project-requirements-change.py b/playbooks/files/project-requirements-change.py index ea8b69bb67..b9ab2e5ee5 100755 --- a/playbooks/files/project-requirements-change.py +++ b/playbooks/files/project-requirements-change.py @@ -100,6 +100,7 @@ def grab_args(): ) parser.add_argument('--local', action='store_true', help='check local changes (not yet in git)') + parser.add_argument('src_dir', help='directory to process') parser.add_argument('branch', nargs='?', default='master', help='target branch for diffs') parser.add_argument('--zc', help='what zuul cloner to call') @@ -149,6 +150,7 @@ def _is_requirement_in_global_reqs(req, global_reqs): def main(): args = grab_args() branch = args.branch + os.chdir(args.src_dir) failed = False # build a list of requirements from the global list in the diff --git a/playbooks/requirements-check.yaml b/playbooks/requirements-check.yaml index d769b9f2b8..b08eebd27e 100644 --- a/playbooks/requirements-check.yaml +++ b/playbooks/requirements-check.yaml @@ -1,6 +1,4 @@ - hosts: all tasks: - name: Run requirements check script - script: "files/project-requirements-change.py {{ zuul.branch }}" - args: - chdir: "{{ zuul.project.src_dir }}" + script: "files/project-requirements-change.py {{ zuul.project.src_dir }} {{ zuul.branch }}"