@@ -73,7 +73,7 @@ def __post_init__(self):
73
73
self .oci_key_profile = self .oci_key_profile or os .environ .get (
74
74
"OCI_CONFIG_PROFILE" , DEFAULT_PROFILE
75
75
)
76
- self .oci_config = self .oci_config or {}
76
+ self .oci_config = self .oci_config or {"region" : os . environ [ "OCI_RESOURCE_REGION" ]} if os . environ . get ( "OCI_RESOURCE_REGION" ) else { }
77
77
self .oci_signer_kwargs = self .oci_signer_kwargs or {}
78
78
self .oci_client_kwargs = self .oci_client_kwargs or {}
79
79
@@ -82,7 +82,7 @@ def set_auth(
82
82
auth : Optional [str ] = AuthType .API_KEY ,
83
83
oci_config_location : Optional [str ] = DEFAULT_LOCATION ,
84
84
profile : Optional [str ] = DEFAULT_PROFILE ,
85
- config : Optional [Dict ] = {},
85
+ config : Optional [Dict ] = {"region" : os . environ [ "OCI_RESOURCE_REGION" ]} if os . environ . get ( "OCI_RESOURCE_REGION" ) else { },
86
86
signer : Optional [Any ] = None ,
87
87
signer_callable : Optional [Callable ] = None ,
88
88
signer_kwargs : Optional [Dict ] = {},
@@ -678,7 +678,7 @@ def create_signer(self) -> Dict:
678
678
>>> signer_generator = AuthFactory().signerGenerator(AuthType.RESOURCE_PRINCIPAL)
679
679
>>> signer_generator(signer_args).create_signer()
680
680
"""
681
- configuration = ads .telemetry .update_oci_client_config ()
681
+ configuration = ads .telemetry .update_oci_client_config (AuthState (). oci_config )
682
682
signer_dict = {
683
683
"config" : configuration ,
684
684
"signer" : oci .auth .signers .get_resource_principals_signer (),
@@ -739,7 +739,7 @@ def create_signer(self) -> Dict:
739
739
>>> signer_generator = AuthFactory().signerGenerator(AuthType.INSTANCE_PRINCIPAL)
740
740
>>> signer_generator(signer_args).create_signer()
741
741
"""
742
- configuration = ads .telemetry .update_oci_client_config ()
742
+ configuration = ads .telemetry .update_oci_client_config (AuthState (). oci_config )
743
743
signer_dict = {
744
744
"config" : configuration ,
745
745
"signer" : oci .auth .signers .InstancePrincipalsSecurityTokenSigner (
0 commit comments