Quote the state value, it may include spaces. 84/3784/4
authorTodd Malsbary <todd.malsbary@intel.com>
Fri, 2 Oct 2020 16:52:37 +0000 (09:52 -0700)
committerKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
Sat, 7 Nov 2020 00:39:26 +0000 (00:39 +0000)
This prevents the "./02_verify.sh: line 22: [: too many arguments"
error when the state is, for example, "registration error".

Issue-ID: ICN-476
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I2228a127e3e4cff56c8689af6fe0accd3e3b3240

deploy/metal3/scripts/02_verify.sh

index 09030c1..a6a1023 100755 (executable)
@@ -19,7 +19,7 @@ function check_provisioned {
         state=$(kubectl get baremetalhosts $name -n metal3 -o json | jq -r '.status.provisioning.state')
         echo "Baremetal host metal3 state - "$name" : "$state
 
-        if [ $state == "provisioned" ];then
+        if [ "$state" == "provisioned" ];then
             current_host_state=1
         fi