oci-utils icon indicating copy to clipboard operation
oci-utils copied to clipboard

oci-public-ip -j doesn't print valid json, -g has extra text

Open cpoczatek opened this issue 1 year ago • 3 comments

In some situations, it looks like warning messages are getting sent to stdout when they should maybe get sent to stderr. I don't know why this warning appears either, as it's a vanilla instance in IAD with 1 vnic. Actual ip obfuscated.

sudo dnf list installed | grep utils | grep oci
oci-utils.noarch                         0.14.0-2.el8                                @ol8_oci_included 

oci-public-ip -j
No public ip addresses found from OCI, falling back to the stun servers.
The stun servers do not provide details on the vNIC and might find only the primary IP address.

[{"IP Address": "XXX"}]

oci-public-ip -j 2>/dev/null
No public ip addresses found from OCI, falling back to the stun servers.
The stun servers do not provide details on the vNIC and might find only the primary IP address.

[{"IP Address": "XXX"}]

oci-public-ip -j 2>/dev/null | jq .
parse error: Invalid numeric literal at line 1, column 3

oci-public-ip -g
No public ip addresses found from OCI, falling back to the stun servers.
The stun servers do not provide details on the vNIC and might find only the primary IP address.

   XXX

oci-public-ip -g 2>/dev/null
No public ip addresses found from OCI, falling back to the stun servers.
The stun servers do not provide details on the vNIC and might find only the primary IP address.

   XXX

cpoczatek avatar Feb 17 '23 20:02 cpoczatek