diff --git a/leapp/utils/audit/contextclone.py b/leapp/utils/audit/contextclone.py index 1c80f2cb8..d988d06df 100644 --- a/leapp/utils/audit/contextclone.py +++ b/leapp/utils/audit/contextclone.py @@ -70,14 +70,14 @@ def _dup_audit(db, message, data_source, newcontext, oldcontext): return lookup -def _dup_metadata(db, newcontext, oldcontext): - for row in _fetch_table_for_context(db, 'metadata', oldcontext): - # id context kind name metadata - row_id, kind, name, metadata = _row_tuple(row, 'id', 'kind', 'name', 'metadata') +def _dup_entity(db, newcontext, oldcontext): + for row in _fetch_table_for_context(db, 'entity', oldcontext): + # id context kind name metadata_hash + row_id, kind, name, metadata_hash = _row_tuple(row, 'id', 'kind', 'name', 'metadata_hash') db.execute( - 'INSERT INTO metadata (context, kind, name, metadata) VALUES(?, ?, ?, ?)', - (newcontext, kind, name, metadata)) + 'INSERT INTO entity (context, kind, name, metadata_hash) VALUES(?, ?, ?, ?)', + (newcontext, kind, name, metadata_hash)) def _dup_dialog(db, data_source, newcontext, oldcontext): @@ -102,5 +102,5 @@ def clone_context(oldcontext, newcontext, use_db=None): message = _dup_message(db=db, data_source=data_source, newcontext=newcontext, oldcontext=oldcontext) # Last clone message entries and use the lookup table generated by the data_source and message duplications _dup_audit(db=db, data_source=data_source, message=message, newcontext=newcontext, oldcontext=oldcontext) - _dup_metadata(db=db, oldcontext=oldcontext, newcontext=newcontext) + _dup_entity(db=db, oldcontext=oldcontext, newcontext=newcontext) _dup_dialog(db=db, data_source=data_source, oldcontext=oldcontext, newcontext=newcontext)