From 41fa1d3e3fe92e96f8c8de99640e06ec910b0303 Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Wed, 8 Jan 2020 14:08:53 +0200 Subject: [PATCH] Made collect an abstract method --- .../infection_monkey/system_info/system_info_collector.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/monkey/infection_monkey/system_info/system_info_collector.py b/monkey/infection_monkey/system_info/system_info_collector.py index 3a977fcde..f65b4c080 100644 --- a/monkey/infection_monkey/system_info/system_info_collector.py +++ b/monkey/infection_monkey/system_info/system_info_collector.py @@ -1,11 +1,11 @@ from config import WormConfiguration from infection_monkey.utils.plugins.plugin import Plugin - +from abc import ABCMeta, abstractmethod import infection_monkey.system_info.collectors -class SystemInfoCollector(Plugin): +class SystemInfoCollector(Plugin, metaclass=ABCMeta): def __init__(self, name="unknown"): self.name = name @@ -21,10 +21,10 @@ class SystemInfoCollector(Plugin): def base_package_name(): return infection_monkey.system_info.collectors.__package__ + @abstractmethod def collect(self) -> dict: """ Collect the relevant information and return it in a dictionary. To be implemented by each collector. - TODO should this be an abstractmethod, or will that ruin the plugin system somehow? if can be abstract should add UT """ raise NotImplementedError()