declare -i current_host_state=0
if kubectl get baremetalhost $name -n metal3 &>/dev/null; then
state=$(kubectl get baremetalhosts $name -n metal3 -o json | jq -r '.status.provisioning.state')
declare -i current_host_state=0
if kubectl get baremetalhost $name -n metal3 &>/dev/null; then
state=$(kubectl get baremetalhosts $name -n metal3 -o json | jq -r '.status.provisioning.state')