Merge branch 'feature/210-monkey-mia-timeout' into improvement/232-dont-show-linux-in-cred-map

This commit is contained in:
Shay Nehmad 2019-05-07 18:59:44 +03:00
commit 477608df0f
1 changed files with 5 additions and 3 deletions

View File

@ -106,7 +106,8 @@ class NodeService:
@staticmethod @staticmethod
def get_monkey_critical_services(monkey_id): def get_monkey_critical_services(monkey_id):
critical_services = mongo.db.monkey.find_one({'_id': monkey_id}, {'critical_services': 1}).get('critical_services', []) critical_services = mongo.db.monkey.find_one({'_id': monkey_id}, {'critical_services': 1}).get(
'critical_services', [])
return critical_services return critical_services
@staticmethod @staticmethod
@ -296,7 +297,8 @@ class NodeService:
@staticmethod @staticmethod
def is_any_monkey_alive(): def is_any_monkey_alive():
return models.Monkey.objects(dead=False).count() > 0 all_monkeys = models.Monkey.objects()
return any(not monkey.is_dead() for monkey in all_monkeys)
@staticmethod @staticmethod
def is_any_monkey_exists(): def is_any_monkey_exists():