"""
This migration adds cpanel virtfs directory (/home/virtfs) to ignore
for malware scanning
"""
from defence360agent.subsys.panels.cpanel import cPanel


def migrate(migrator, database, fake=False, **kwargs):
    if (not fake) and cPanel.is_installed():
        MalwareIgnorePath = migrator.orm["malware_ignore_path"]
        MalwareIgnorePath.get_or_create(path="/home/virtfs")


def rollback(migrator, database, fake=False, **kwargs):
    pass
