Пример #1
0
 def refresh_all(self) -> int:
     count = 0
     for ci in _clamav_items():
         if self.refresh(ci):
             command = ci.on_update
             if command:
                 run_command(command, config.on_update_timeout(), log, path=ci.path)
             count += 1
     command = config.on_update_exec()
     if count > 0 and command:
         run_command(command, config.on_update_timeout(), log)
     return count
Пример #2
0
 def refresh_all(self) -> int:
     count = self.cleanup_providers()
     for ci in _clamav_items():
         if self.refresh(ci):
             command = ci.on_update
             if command:
                 run_command(command,
                             config.on_update_timeout(),
                             log_info,
                             log_error,
                             log_exception,
                             path=ci.path)
             count += 1
     command = config.on_update_exec()
     if count > 0 and command:
         run_command(command, config.on_update_timeout(), log_info,
                     log_error, log_exception)
     return count
Пример #3
0
 def test_run_unknown(self):
     self.assertTrue(0 < run_command(self.UNKNOWN, 3, log_info, log_error, log_exception))
Пример #4
0
 def test_run_echo(self):
     self.assertEqual(0, run_command('echo > {path}', 3, log_info, log_error, log_exception, path=os.devnull))
Пример #5
0
 def test_run_unknown(self):
     self.assertTrue(0 < run_command(self.UNKNOWN, 3, log))
Пример #6
0
 def test_run_echo(self):
     self.assertEqual(0, run_command('echo > {path}', 3, log, path=os.devnull))