Skip to content

Commit 2c22375

Browse files
committed
debug DIRT migration
1 parent f5183e1 commit 2c22375

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

plantit/plantit/celery_tasks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,7 @@ def start_dirt_migration(self, username: str):
11331133
for file in image_files:
11341134
# get file entity ID given root image file ID
11351135
file_entity_id = mig.get_file_entity_id(file.id)
1136+
file.entity_id = file_entity_id
11361137

11371138
# if no corresponding file entity for this managed file, skip it
11381139
if file_entity_id is None:
@@ -1206,6 +1207,8 @@ def start_dirt_migration(self, username: str):
12061207
orphan=file.orphan,
12071208
missing=file.missing,
12081209
uploaded=file.uploaded,
1210+
entity_id=file.file_entity_id,
1211+
collection_entity_id=file.collection_entity_id,
12091212
nfs_path=join(rootnfs_dir, 'root-images', file.folder, file.name),
12101213
staging_path=join(staging_dir, file.name))
12111214
for file in metadata_files:

plantit/plantit/migration.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ class ManagedFile(NamedTuple):
7171
orphan: bool
7272
missing: bool
7373
uploaded: Optional[str]
74-
entity_id: str
75-
collection_entity_id: str
74+
entity_id: Optional[str]
75+
collection_entity_id: Optional[str]
7676

7777

7878
def row_to_managed_file(row):
@@ -94,7 +94,7 @@ def row_to_managed_file(row):
9494
return ManagedFile(
9595
id=fid,
9696
name=name,
97-
path=path.replace('public://', ''),
97+
nfs_path=path.replace('public://', ''),
9898
type='metadata',
9999
folder=path.rpartition('metadata-files')[2].replace(name, '').replace('/', ''),
100100
orphan=False,
@@ -105,7 +105,7 @@ def row_to_managed_file(row):
105105
return ManagedFile(
106106
id=fid,
107107
name=name,
108-
path=path.replace('public://', ''),
108+
nfs_path=path.replace('public://', ''),
109109
type='output',
110110
folder=folder,
111111
orphan=False,
@@ -115,7 +115,7 @@ def row_to_managed_file(row):
115115
return ManagedFile(
116116
id=fid,
117117
name=name,
118-
path=path.replace('public://', ''),
118+
nfs_path=path.replace('public://', ''),
119119
type='logs',
120120
folder=path.rpartition('output-logs')[2].replace(name, '').replace('/', ''),
121121
orphan=False,

0 commit comments

Comments
 (0)