Browse Source

HUE-4801 [oozie] When importing oozie documents and remapping UUIDs, data should be updated accordingly

Jenny Kim 9 years ago
parent
commit
0662519e17
1 changed files with 7 additions and 0 deletions
  1. 7 0
      desktop/core/src/desktop/api2.py

+ 7 - 0
desktop/core/src/desktop/api2.py

@@ -504,6 +504,13 @@ def _copy_document_with_owner(doc, owner, uuids_map):
     uuids_map[old_uuid] = uuid_default()
   doc['fields']['uuid'] = uuids_map[old_uuid]
 
+  # Update UUID in data if needed
+  if 'data' in doc['fields']:
+    data = json.loads(doc['fields']['data'])
+    if 'uuid' in data:
+      data['uuid'] = uuids_map[old_uuid]
+      doc['fields']['data'] = json.dumps(data)
+
   # Remap parent directory if needed
   parent_uuid = None
   if 'parent_directory' in doc['fields']: