diff --git a/chaos_monkey/monkey.py b/chaos_monkey/monkey.py index 74af64daf..020097c64 100644 --- a/chaos_monkey/monkey.py +++ b/chaos_monkey/monkey.py @@ -103,8 +103,9 @@ class ChaosMonkey(object): machines = self._network.get_victim_machines(WormConfiguration.scanner_class, max_find=WormConfiguration.victims_max_find) - + is_empty = True for machine in machines: + is_empty = False for finger in self._fingerprint: LOG.info("Trying to get OS fingerprint from %r with module %s", machine, finger.__class__.__name__) @@ -169,7 +170,7 @@ class ChaosMonkey(object): else: self._fail_exploitation_machines.add(machine) - if machines: + if not is_empty: time.sleep(WormConfiguration.timeout_between_iterations) if self._keep_running and WormConfiguration.alive: diff --git a/chaos_monkey/tunnel.py b/chaos_monkey/tunnel.py index a3b37a470..de1484d6e 100644 --- a/chaos_monkey/tunnel.py +++ b/chaos_monkey/tunnel.py @@ -17,7 +17,7 @@ MCAST_GROUP = '224.1.1.1' MCAST_PORT = 5007 BUFFER_READ = 1024 DEFAULT_TIMEOUT = 10 -QUIT_TIMEOUT = 1200 # 20 minutes +QUIT_TIMEOUT = 60 * 10 # 10 minutes def _set_multicast_socket(timeout=DEFAULT_TIMEOUT):