File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
tests/unitary/default_setup/auth Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -517,17 +517,12 @@ def create_signer(self) -> Dict:
517517 """
518518 if self .oci_config :
519519 configuration = ads .telemetry .update_oci_client_config (self .oci_config )
520+ elif self .signer_kwargs :
521+ configuration = ads .telemetry .update_oci_client_config (self .signer_kwargs )
520522 else :
521- try :
522- configuration = ads .telemetry .update_oci_client_config (
523- oci .config .from_file (self .oci_config_location , self .oci_key_profile )
524- )
525- except :
526- if not os .path .exists (os .path .expanduser (self .oci_config_location )):
527- logger .info (f"Failed to get config from folder { self .oci_config_location } . Using 'signer_kwargs' instead." )
528- configuration = ads .telemetry .update_oci_client_config (self .signer_kwargs )
529- else :
530- raise
523+ configuration = ads .telemetry .update_oci_client_config (
524+ oci .config .from_file (self .oci_config_location , self .oci_key_profile )
525+ )
531526
532527 logger .info (f"Using 'api_key' authentication." )
533528 return {
Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ def test_set_auth_with_kwargs(self, mock_load_private_key):
114114 assert signer ["config" ]["key_content" ] == "test_key_content"
115115 assert "additional_user_agent" in signer ["config" ]
116116 assert signer ["signer" ] != None
117+ set_auth ()
117118
118119class TestOCIMixin (TestCase ):
119120 def tearDown (self ) -> None :
You can’t perform that action at this time.
0 commit comments