File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2- set -e
2+ set -e
3+
4+ # Function to detect available python binary
5+ get_python_cmd () {
6+ if command -v python3 & > /dev/null; then
7+ echo " python3"
8+ elif command -v python & > /dev/null; then
9+ echo " python"
10+ else
11+ echo " ERROR: Neither python3 nor python is available" >&2
12+ exit 1
13+ fi
14+ }
315
416if [ " $# " -ne 1 ]; then
517 echo " Error: Exactly one argument is required."
98110echo " ---------------------"
99111echo " defining both clusters (hub and spoke)"
100112echo " ---------------------"
101- python rhdp/rhdp-cluster-define.py --multicluster ${AZUREREGION}
113+ PYTHON_CMD=$( get_python_cmd)
114+ $PYTHON_CMD rhdp/rhdp-cluster-define.py --multicluster ${AZUREREGION}
102115echo " ---------------------"
103116echo " clusters defined"
104117echo " ---------------------"
Original file line number Diff line number Diff line change 11
22#! /usr/bin/env bash
3- set -e
3+ set -e
4+
5+ # Function to detect available python binary
6+ get_python_cmd () {
7+ if command -v python3 & > /dev/null; then
8+ echo " python3"
9+ elif command -v python & > /dev/null; then
10+ echo " python"
11+ else
12+ echo " ERROR: Neither python3 nor python is available" >&2
13+ exit 1
14+ fi
15+ }
416
517if [ " $# " -ne 1 ]; then
618 echo " Error: Exactly one argument is required."
100112echo " ---------------------"
101113echo " defining cluster"
102114echo " ---------------------"
103- python rhdp/rhdp-cluster-define.py ${AZUREREGION}
115+ PYTHON_CMD=$( get_python_cmd)
116+ $PYTHON_CMD rhdp/rhdp-cluster-define.py ${AZUREREGION}
104117echo " ---------------------"
105118echo " cluster defined"
106119echo " ---------------------"
You can’t perform that action at this time.
0 commit comments