wo4hddlZddlZddlZddlmZmZddlmZddlm Z ej dddZ ej e ZdZd Zd d Zd d ZdS)N) CharFieldModel)importer) FilenameFieldzimav.malwarelib.cleanup.storageCleanupStorage)modulenamedefaultc2Gfddt}|S)zl Model stub for migration because we can't use migrator.orm[] due to custom field FilenameField ceZdZGfddZedZedZedZedZ e de fdZ dS) get_model..MalwareHitceZdZdZZdS)"get_model..MalwareHit.Meta malware_hitsN)__name__ __module__ __qualname__db_tabledatabasedbsn/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/migrations/128_move_cleanup_storage_files.pyMetars%HHHHrF)nullTreturnc tjj|j|j|jgS#t$rYdSwxYw)zZ Get file name for cleanup storage :return: file name N)ospathextsepjoinuserhashsize TypeError)selfs r storage_namez*get_model..MalwareHit.storage_name#sN  w~**DIty$)+LMMM   tt s58 AAN) rrrrrr"r orig_filer#r$propertystrr'rsr MalwareHitr s          ye$$$!Mu--- yd###yd###  #       rr+)r)rr+s` r get_modelr,s? U* rc,ttjj||f\}}tt||f\}} t j||dS#t$rYdSt$r&}t d|Yd}~dSd}~wwxYw)Nz2Failed to move stored file to the new location: %r) maprrjoinpathr*shutilmoveFileNotFoundError Exceptionloggererror)srcdsterrs r_mover91s>&/#s<s rrollbackrCKsDr)F)loggingrr0peeweerrdefence360agent.utilsr$defence360agent.model.simplificationrgetr getLoggerrr4r,r9r@rCrBrrrJs ########******>>>>>> ,    8 $ $<PPP          r