Пример #1
0
        if not prefs.get('PURGE_DENY'):
            lock_file.remove()
            die("You have supplied the --migrate flag however you have not set PURGE_DENY in your configuration file."
                )
        else:
            m = Migrate(prefs.get("HOSTS_DENY"))

    # clear out specific IP addresses
    if purgeip and not daemon:
        if len(purgeip_list) < 1:
            lock_file.remove()
            die("You have provided the --purgeip flag however you have not listed any IP addresses to purge."
                )
        else:
            try:
                p = PurgeIP(prefs, purgeip_list)

            except Exception as e:
                lock_file.remove()
                die(str(e))

    # Try to purge old records without any delay
    if purge_all and not daemon:
        purge_time = 1
        try:
            p = Purge(prefs, purge_time)
        except Exception as e:
            lock_file.remove()
            die(str(e))

    if purge and not (daemon or foreground):
Пример #2
0
        if not prefs.get('PURGE_DENY'):
            lock_file.remove()
            die("You have supplied the --migrate flag however you have not set PURGE_DENY in your configuration file.")
        else:
            m = Migrate(prefs.get("HOSTS_DENY"))

    if purgeip or purge or purge_all:
        removed_hosts = None
        # clear out specific IP addresses
        if purgeip and not daemon:
            if len(purgeip_list) < 1:
                lock_file.remove()
                die("You have provided the --purgeip flag however you have not listed any IP addresses to purge.")
            else:
                try:
                    ip_purger = PurgeIP(prefs, purgeip_list)
                    removed_hosts = ip_purger.run_purge()
                except Exception as e:
                    lock_file.remove()
                    die(str(e))

        # Try to purge old records without any delay
        if purge_all and not daemon:
            purge_time = 1
            try:
                purger = Purge(prefs, purge_time)
                removed_hosts = purger.run_purge()
            except Exception as e:
                lock_file.remove()
                die(str(e))