File tree 1 file changed +8
-14
lines changed
1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -645,23 +645,17 @@ def get_metadata_content(
645
645
if path_type == MetadataArtifactPathType .CONTENT :
646
646
return artifact_path_or_content
647
647
648
- elif path_type == MetadataArtifactPathType .LOCAL :
649
- if not utils .is_path_exists (artifact_path_or_content ):
650
- raise FileNotFoundError (
651
- f"File not found: { artifact_path_or_content } . "
652
- )
653
-
654
- with open (artifact_path_or_content , "rb" ) as f :
655
- contents = f .read ()
656
- logger .info (f"The metadata artifact content - { contents } " )
657
-
658
- return contents
659
-
660
- elif path_type == MetadataArtifactPathType .OSS :
648
+ elif (
649
+ path_type == MetadataArtifactPathType .LOCAL
650
+ or path_type == MetadataArtifactPathType .OSS
651
+ ):
661
652
if not utils .is_path_exists (artifact_path_or_content ):
662
653
raise FileNotFoundError (f"File not found: { artifact_path_or_content } " )
654
+ signer = (
655
+ default_signer () if path_type == MetadataArtifactPathType .OSS else {}
656
+ )
663
657
contents = read_file (
664
- file_path = artifact_path_or_content , auth = default_signer ()
658
+ file_path = artifact_path_or_content , auth = signer
665
659
).encode ()
666
660
logger .debug (f"The metadata artifact content - { contents } " )
667
661
You can’t perform that action at this time.
0 commit comments