From a85b54e08d98d03927cdf14616e08d45601aee5c Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Tue, 26 Sep 2017 14:49:00 -0700 Subject: [PATCH] Remove gratuitous use of xargs Find can do the thing we want it to do without involving xargs. The -exec {} + construct will put all the found files into one long set of arguments (up to the limit, at which point additional commands will be constructed). Failures of exec will result in nonzero return of find. Change-Id: I4427a259df29c3f31581c7452cd0cf5e1bc78416 Signed-off-by: Jesse Keating --- tox.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index b72d14f2..4e700b53 100644 --- a/tox.ini +++ b/tox.ini @@ -30,11 +30,11 @@ commands = # Ansible Lint Check # NOTE(pabelanger): Ignore the following checks: # ANSIBlE0012: Commands should not change things if nothing needs doing - bash -c "cd playbooks; find . -type f -regex '.*.y[a]?ml' -not -path './legacy/*' -print0 | xargs -t -0 \ - ansible-lint -x ANSIBLE0012" + bash -c "cd playbooks; find . -type f -regex '.*.y[a]?ml' -not -path './legacy/*' -exec \ + ansible-lint -x ANSIBLE0012 \{\} +" # Ansible Syntax Check - bash -c "cd playbooks; find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -0 \ - ansible-playbook --syntax-check -i {toxinidir}/tests/inventory > /dev/null" + bash -c "cd playbooks; find . -type f -regex '.*.y[a]?ml' -exec \ + ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null" [testenv:venv] commands = {posargs}