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:
517
517
"""
518
518
if self .oci_config :
519
519
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 )
520
522
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
+ )
531
526
532
527
logger .info (f"Using 'api_key' authentication." )
533
528
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):
114
114
assert signer ["config" ]["key_content" ] == "test_key_content"
115
115
assert "additional_user_agent" in signer ["config" ]
116
116
assert signer ["signer" ] != None
117
+ set_auth ()
117
118
118
119
class TestOCIMixin (TestCase ):
119
120
def tearDown (self ) -> None :
You can’t perform that action at this time.
0 commit comments