Skip to content

Commit 034fd33

Browse files
committed
change in the provisioner default script
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent b175ef9 commit 034fd33

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/vm/hypervisor/external/provisioner/provisioner.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ status() {
9999
echo '{"status": "success", "power_state": "poweron"}'
100100
}
101101

102+
statuses() {
103+
parse_json "$1" || exit 1
104+
# This external system can not return an output like the following:
105+
# {"status":"success","power_state":{"i-3-23-VM":"poweroff","i-2-25-VM":"poweron"}}
106+
# CloudStack can fallback to retrieving the power state of the single VM using the "status" action
107+
echo '{"status": "error", "message": "Not supported"}'
108+
}
109+
102110
action=$1
103111
parameters_file="$2"
104112
wait_time="$3"
@@ -138,6 +146,9 @@ case $action in
138146
status)
139147
status "$parameters"
140148
;;
149+
statuses)
150+
statuses "$parameters"
151+
;;
141152
*)
142153
echo '{"error":"Invalid action"}'
143154
exit 1

0 commit comments

Comments
 (0)