File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Expand file tree Collapse file tree 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(
645645 if path_type == MetadataArtifactPathType .CONTENT :
646646 return artifact_path_or_content
647647
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+ ):
661652 if not utils .is_path_exists (artifact_path_or_content ):
662653 raise FileNotFoundError (f"File not found: { artifact_path_or_content } " )
654+ signer = (
655+ default_signer () if path_type == MetadataArtifactPathType .OSS else {}
656+ )
663657 contents = read_file (
664- file_path = artifact_path_or_content , auth = default_signer ()
658+ file_path = artifact_path_or_content , auth = signer
665659 ).encode ()
666660 logger .debug (f"The metadata artifact content - { contents } " )
667661
You can’t perform that action at this time.
0 commit comments