Skip to content

Commit cadbab1

Browse files
committed
Updated pr.
1 parent 68d4b59 commit cadbab1

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

ads/common/dsc_file_system.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,14 @@ def update_from_dsc_model(cls, dsc_model) -> dict:
204204
raise ValueError(
205205
"Missing parameter `destination_directory_name` from service. Check service log to see the error."
206206
)
207+
208+
dest = dsc_model.destination_directory_name
209+
if dsc_model.destination_path:
210+
dest = f"{dsc_model.destination_path.rstrip('/')}/{dsc_model.destination_directory_name}"
207211

208212
return {
209213
"src" : f"{dsc_model.mount_target_id}:{dsc_model.export_id}",
210-
"dest" : f"{(dsc_model.destination_path or '').rstrip('/')}/{dsc_model.destination_directory_name}"
214+
"dest" : dest
211215
}
212216

213217
@dataclass
@@ -249,9 +253,13 @@ def update_from_dsc_model(cls, dsc_model) -> dict:
249253
"Missing parameter `destination_directory_name` from service. Check service log to see the error."
250254
)
251255

256+
dest = dsc_model.destination_directory_name
257+
if dsc_model.destination_path:
258+
dest = f"{dsc_model.destination_path.rstrip('/')}/{dsc_model.destination_directory_name}"
259+
252260
return {
253261
"src" : f"oci://{dsc_model.bucket}@{dsc_model.namespace}/{dsc_model.prefix or ''}",
254-
"dest" : f"{(dsc_model.destination_path or '').rstrip('/')}/{dsc_model.destination_directory_name}"
262+
"dest" : dest
255263
}
256264

257265

tests/unitary/default_setup/jobs/test_jobs_mount_file_system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ def test_dsc_file_storage_error(self):
532532
def test_get_destination_path_and_name(self):
533533
path, directory = OCIFileStorage.get_destination_path_and_name("abc")
534534

535-
assert path == ""
535+
assert path == None
536536
assert directory == "abc"
537537

538538
path, directory = OCIFileStorage.get_destination_path_and_name("/abc")

0 commit comments

Comments
 (0)