Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oci raw-request doesn't honor environment variable OCI_CLI_USE_INSTANCE_METADATA_SERVICE #738

Open
w1z2g3 opened this issue Dec 20, 2023 · 0 comments

Comments

@w1z2g3
Copy link

w1z2g3 commented Dec 20, 2023

Is this design on purpose? If not, a potential untested fix:

diff --git a/src/oci_cli/cli_util.py b/src/oci_cli/cli_util.py
index 1356358b..87f6f8c1 100644
--- a/src/oci_cli/cli_util.py
+++ b/src/oci_cli/cli_util.py
@@ -466,6 +466,10 @@ def set_request_session_properties_from_context(session, ctx, uses_ssl=True):


 def build_raw_requests_session(ctx):
+
+    if 'OCI_CLI_USE_INSTANCE_METADATA_SERVICE' in os.environ:
+        oci.regions.enable_instance_metadata_service()
+
     config_and_signer = create_config_and_signer_based_on_click_context(ctx)
     signer = config_and_signer.signer
     client_config = config_and_signer.config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant