From 04c86737e967841c2e36482308169ed39fdd3421 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Thu, 31 Aug 2017 11:03:31 +0300 Subject: [PATCH] Fix check for manual infection --- monkey_island/cc/resources/node.py | 2 +- monkey_island/cc/services/node.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/monkey_island/cc/resources/node.py b/monkey_island/cc/resources/node.py index aaea85463..d3c61f76f 100644 --- a/monkey_island/cc/resources/node.py +++ b/monkey_island/cc/resources/node.py @@ -13,6 +13,6 @@ class Node(flask_restful.Resource): def get(self): node_id = request.args.get('id') if node_id: - return NodeService.get_displayed_node_by_id(request.args.get('node_id')) + return NodeService.get_displayed_node_by_id(node_id) return {} diff --git a/monkey_island/cc/services/node.py b/monkey_island/cc/services/node.py index b42f25a36..67e7602dd 100644 --- a/monkey_island/cc/services/node.py +++ b/monkey_island/cc/services/node.py @@ -77,8 +77,12 @@ class NodeService: @staticmethod def get_monkey_manual_run(monkey): - # TODO: find better implementation - return monkey["parent"][0][1] == None + for p in monkey["parent"]: + if p[0] != monkey["guid"]: + return False + + return True + @staticmethod def get_monkey_label(monkey):