From 31894171d39b61854ea8a21a894900c26c5c2b87 Mon Sep 17 00:00:00 2001 From: Daniel Miller Date: Thu, 21 Nov 2013 10:28:26 -0500 Subject: [PATCH] Make salt bootstrap work on systems without python --- plugins/provisioners/salt/bootstrap-salt.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/provisioners/salt/bootstrap-salt.sh b/plugins/provisioners/salt/bootstrap-salt.sh index b715c78e6..253d9015b 100755 --- a/plugins/provisioners/salt/bootstrap-salt.sh +++ b/plugins/provisioners/salt/bootstrap-salt.sh @@ -1,6 +1,12 @@ #!/bin/sh - # We just download the bootstrap script by default and execute that. -python \ - -c 'import urllib; print urllib.urlopen("http://bootstrap.saltstack.org").read()' \ - | sh -s -- "$@" +if [ -x /usr/bin/fetch ]; then + /usr/bin/fetch -o - http://bootstrap.saltstack.org | sh -s -- "$@" +elif [ -x /usr/bin/curl ]; then + /usr/bin/curl -L http://bootstrap.saltstack.org | sh -s -- "$@" +else + python \ + -c 'import urllib; print urllib.urlopen("http://bootstrap.saltstack.org").read()' \ + | sh -s -- "$@" +fi