def main():
    fw = Firewall(HOSTNAME, USERNAME, PASSWORD)
    rulebase = fw.add(Rulebase())
    rules = SecurityRule.refreshall(rulebase, add=False)
    print(f'Checking {len(rules)} rules...')
    for rule in rules:
        if (rule.log_setting != LOG_PROFILE):
            print(f'{rule.name}')
            rule.log_setting = LOG_PROFILE
            rule.log_start = 0
            rule.log_end = 1
            rule.apply()
    print('Starting commit')
    fw.commit(sync=True, exception=True)
    print('Commit finished successfully')
def main():
    fw = Firewall(HOSTNAME, USERNAME, PASSWORD)
    rulebase = fw.add(Rulebase())
    rules = SecurityRule.refreshall(rulebase, add=False)
    print(f'Checking {len(rules)} rules...')
    for rule in rules:
        if (rule.log_setting != LOG_PROFILE):
            print(f'{rule.name}')
            rule.log_setting = LOG_PROFILE
            rule.log_start = 0
            rule.log_end = 1
            rule.apply()
    print('Starting commit')
    fw.commit(sync=True, exception=True)
    print('Commit finished successfully')