Skip to content

Commit 880452d

Browse files
committed
Updated pr.
1 parent b7b7e67 commit 880452d

File tree

2 files changed

+12
-29
lines changed

2 files changed

+12
-29
lines changed

ads/common/dsc_file_system.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -164,32 +164,23 @@ def update_from_dsc_model(cls, dsc_model) -> dict:
164164
dict
165165
A dictionary of arguments.
166166
"""
167-
argument = {
168-
"storageType": dsc_model.storage_type,
169-
"mountTargetId": dsc_model.mount_target_id,
170-
"exportId": dsc_model.export_id,
171-
"destinationDirectoryName": dsc_model.destination_directory_name
172-
}
173-
174-
file_storage_client = oci.file_storage.FileStorageClient(
175-
**ads.auth.default_signer()
176-
)
177167
if not dsc_model.mount_target_id:
178168
raise ValueError(
179169
"Missing parameter `mount_target_id` from service. Check service log to see the error."
180170
)
181-
argument["mountTarget"] = file_storage_client.get_mount_target(
182-
mount_target_id=dsc_model.mount_target_id
183-
).data.display_name
184171
if not dsc_model.export_id:
185172
raise ValueError(
186173
"Missing parameter `export_id` from service. Check service log to see the error."
187174
)
188-
argument["exportPath"] = file_storage_client.get_export(
189-
export_id=dsc_model.export_id
190-
).data.path
175+
if not dsc_model.destination_directory_name:
176+
raise ValueError(
177+
"Missing parameter `destination_directory_name` from service. Check service log to see the error."
178+
)
191179

192-
return argument
180+
return {
181+
"src" : f"{dsc_model.mount_target_id}:{dsc_model.export_id}",
182+
"dest" : dsc_model.destination_directory_name
183+
}
193184

194185

195186
class DSCFileSystemManager:

tests/unitary/default_setup/jobs/test_jobs_mount_file_system.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -237,20 +237,12 @@ def test_update_storage_mount_from_dsc_model(
237237
assert isinstance(infrastructure.storage_mount[0], dict)
238238
assert isinstance(infrastructure.storage_mount[1], dict)
239239
assert infrastructure.storage_mount[0] == {
240-
"destinationDirectoryName": "test_destination_directory_name_from_dsc",
241-
"exportId": "export_id_from_dsc",
242-
"exportPath": "export_path_from_dsc",
243-
"mountTarget": "mount_target_from_dsc",
244-
"mountTargetId": "mount_target_id_from_dsc",
245-
"storageType": "FILE_STORAGE",
240+
"src" : "mount_target_id_from_dsc:export_id_from_dsc",
241+
"dest" : "test_destination_directory_name_from_dsc"
246242
}
247243
assert infrastructure.storage_mount[1] == {
248-
"destinationDirectoryName": "test_destination_directory_name_from_dsc",
249-
"exportId": "export_id_from_dsc",
250-
"exportPath": "export_path_from_dsc",
251-
"mountTarget": "mount_target_from_dsc",
252-
"mountTargetId": "mount_target_id_from_dsc",
253-
"storageType": "FILE_STORAGE",
244+
"src" : "mount_target_id_from_dsc:export_id_from_dsc",
245+
"dest" : "test_destination_directory_name_from_dsc"
254246
}
255247

256248
@patch.object(OCIFileStorage, "update_to_dsc_model")

0 commit comments

Comments
 (0)