summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2017-06-07 18:13:09 -0600
committerScott Moser <smoser@ubuntu.com>2017-06-08 07:26:40 -0600
commit7dcc15d02d997e88c075976a55bf07e789cd18fd (patch)
tree35be80b694c6b9c6bb16b65e6945348418889a81 /Makefile
parentecad2211f98ba503c61e3502a04176f41849ff41 (diff)
downloadvyos-cloud-init-7dcc15d02d997e88c075976a55bf07e789cd18fd.tar.gz
vyos-cloud-init-7dcc15d02d997e88c075976a55bf07e789cd18fd.zip
makefile: fix python 2/3 detection in the Makefile
Fix detection of python in a non-python3 environment. The old path always used python3. The 2 fixes here are: a.) escape the '$' before the subshell. b.) use shell builtin 'command -v' rather than 'which' in case 'which' is not available.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 09cd1479..821be4b5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
CWD=$(shell pwd)
PYVER ?= $(shell for p in python3 python2; do \
- out=$(which $$p 2>&1) && echo $$p && exit; done; \
- exit 1)
+ out=$$(command -v $$p 2>&1) && echo $$p && exit; done; exit 1)
+
noseopts ?= -v
YAML_FILES=$(shell find cloudinit bin tests tools -name "*.yaml" -type f )