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
This commit is contained in:
Monty Taylor 2017-10-15 08:57:20 -05:00
parent 6d9fe55d36
commit a4ebb1c463
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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 }}"