K6hd  dZddlZddlZddlmZmZmZmZddlm Z ddl m Z m Z ej eZedZGddejZGdd Zd eefd Ze dd Ze ddZdS)u  This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program.  If not, see . Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see N) IntegerFieldModelSqliteDatabase TextField)skip_for_im360)find_revisium_dbget_all_domainscPeZdZeZeZGddZdS) HashExceptionceZdZdZdS)HashException.Metahash_exceptionN)__name__ __module__ __qualname__db_table]/opt/imunify360/venv/lib/python3.11/site-packages/imav/migrations/007_revisium_ignore_list.pyMetar 's#rrN)rrrr domain_idr file_sub_pathrrrrr r #sR IIKKM$$$$$$$$$$rr c0eZdZUeed<edZdS)dbMalwareIgnorePathc*|jd|_dS)Nmalware_ignore_path)ormr)clsmigrators rinitzdb.init/s ( -B CrN)rrrr__annotations__ classmethodr!rrrrr,s@DD[DDDrrreturnc*t| t}n@#t$r3}td|t cYd}~Sd}~wwxYwt }tD]} |t|j d}n#t$rY0wxYw|j tjj}tj||}|||S)NzFailed to get Plesk domains: %r document_root)rar!r Exceptionloggerwarningsetr strrKeyErrorrlstripospathsepjoinadd)databasedomainse ignore_listrdoc_rootrr0s rget_ignore_listr94sGGH!## 8!<<<uu %%K' s>#;<<=oNHH    H '4;;BGKHH w||Hm44 s,+ A((A#A(#A( B$$ B10B1Fc l|rdSt}|tddSt|}t||D]W} tj|d%#t$r&}t d||Yd}~Pd}~wwxYwdS)Nz/No legacy ImunifyAV database found. Skipping...file)r0 resource_typez'Failed to add %r to the ignore list: %r) rr)infor9rr!rcreater(r*)r r4fakekwargsrevisium_db_pathr7r0r6s rmigraterBKs ')) EFFF!"233KGGHOO O  ' 'T ' H H H H O O O NNDdA N N N N N N N N OOOs!B B1 B,,B1c dS)Nr)r r4r?r@s rrollbackrD_sDr)F)__doc__loggingr/peeweerrrrimav.migration_utils.otherrimav.migration_utils.revisiumrr getLoggerrr)r'r rr+r,r9rBrDrrrrKs[* AAAAAAAAAAAA555555KKKKKKKK  8 $ $^D$$$$$BH$$$DDDDDDDDS.OOOO&      r