fix: split OCI compartment inventory lines
This commit is contained in:
parent
a300a50663
commit
d4e7341014
|
|
@ -3532,7 +3532,7 @@ oci_status() {
|
|||
local compartment_ids resource_compartments current_compartment
|
||||
compartment_ids="$("${oci_bin}" iam compartment list --compartment-id "${tenancy}" \
|
||||
--compartment-id-in-subtree true --all --output json 2>/dev/null \
|
||||
| python3 -c 'import json,sys; print("\\n".join(x["id"] for x in json.load(sys.stdin).get("data", [])))' 2>/dev/null || true)"
|
||||
| python3 -c 'import json,sys; print("\n".join(x["id"] for x in json.load(sys.stdin).get("data", [])))' 2>/dev/null || true)"
|
||||
resource_compartments="${tenancy}"$'\n'"${compartment_ids}"
|
||||
printf '%s\n' '-- compute instances (all compartments)'
|
||||
while IFS= read -r current_compartment; do
|
||||
|
|
@ -3603,7 +3603,7 @@ oci_doctor() {
|
|||
|
||||
states="$("${oci_bin}" compute instance list --compartment-id "${compartment}" --all \
|
||||
--output json 2>/dev/null \
|
||||
| python3 -c 'import json,sys; print("\\n".join(x["lifecycle-state"] for x in json.load(sys.stdin).get("data", [])))' 2>/dev/null || true)"
|
||||
| python3 -c 'import json,sys; print("\n".join(x["lifecycle-state"] for x in json.load(sys.stdin).get("data", [])))' 2>/dev/null || true)"
|
||||
if [[ -n "${states}" ]]; then
|
||||
bad_state="$(printf '%s\n' "${states}" | grep -Ev '^(RUNNING|STOPPED|STOPPING|STARTING|TERMINATED|TERMINATING|PROVISIONING)$' || true)"
|
||||
if [[ -n "${bad_state}" ]]; then
|
||||
|
|
|
|||
Loading…
Reference in New Issue