Open cpoczatek opened 1 year ago
The message on using the stun servers is not warning, it is informational, in situations where you cannot get the public ip data from OCI, it falls back to scanning, which does not guarantee all data is found. the -j and -g options (which are both deprecated) work fine on the test env, oci-utils 0.14.0-2 `# oci-public-ip --help usage: oci-public-ip [--output-mode {parsable,table,json,text}] [-d] [-s SOURCEIP] [-S STUN_SERVER] [-L] [--instance-id OCID] [--help]
Utility for displaying the public IP address of the current OCI instance.
optional arguments: --output-mode {parsable,table,json,text} Set output mode -d, --details display details information -s SOURCEIP, --sourceip SOURCEIP Specify the source IP address to use -S STUN_SERVER, --stun-server STUN_SERVER Specify the STUN server to use -L, --list-servers Print a list of known STUN servers and exit --instance-id OCID Display the public IP address of the given instance instead of the current one. Requires the OCI Python SDK to be installed and configured `
Ok, it's informational but it should still go to stderr imo. If -j/-g
are deprecated, there's no warning that they are on use.
Am I correct in assuming the ability to get public ip data "from OCI" means there's an instance principal (or similar) to allow API calls? I would say the base case of just having created an instance is the simpler situation and should give valid json even if it's not guaranteed.
oci-public-ip --output-mode json | jq .
parse error: Invalid numeric literal at line 1, column 3
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>
BrokenPipeError: [Errno 32] Broken pipe
I agree it the information should go to stderr; . the public ip is not in the metadata, if you do not have instance principal nor direct authentication set up, the only way is using stun servers. I cannot reproduce your output...
[ { "IP Address": "www.xxx.yyy.zzz" } ] please file a ticket at oracle
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.