#!/bin/sh

set -u

for py in 'python3' 'python'; do
  exe=$(type -p ${py})
  if [ -n "${exe}" ]; then
    if ${exe} -c 'import salt.config'; then
      ${exe} "$@"
      exit $?
    fi
  fi
done

echo "No usable python version found, check if python or python3 can import salt.config!" 1>&2
exit 1
