+ if kubectl get baremetalhost $name -n metal3 &>/dev/null; then
+ state=$(kubectl get baremetalhosts $name -n metal3 -o json | jq -r '.status.provisioning.state')
+ else
+ # When the named BareMetalHost is not found, assume its deprovisioned
+ state="ready"
+ fi