resolve mock.patch issues on cuckoo.common

This commit is contained in:
Jurriaan Bremer
2017-12-03 15:26:19 +01:00
parent 404d4918f3
commit 9d2edb7710
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ class ExtractManager(object):
ext.yara_rules = ext.yara_rules,
def __del__(self):
ExtractManager._instances.pop(self.task_id, None)
self._instances.pop(self.task_id, None)
def write_extracted(self, ext, payload):
dirpath = cwd("extracted", analysis=self.task_id)
+2 -1
View File
@@ -119,6 +119,7 @@ def load_signatures():
# Forward everything from lib.cuckoo to "our" cuckoo module.
sys.modules["lib"] = types.ModuleType("lib")
sys.modules["lib.cuckoo"] = sys.modules["cuckoo"]
sys.modules["lib.cuckoo.common"] = sys.modules["cuckoo.common"]
# Import this here in order to avoid recursive import statements.
from cuckoo.common.abstracts import Signature
@@ -133,7 +134,7 @@ def load_signatures():
dont_write_bytecode = sys.dont_write_bytecode
sys.dont_write_bytecode = True
# Trigger an import on $CWD/signatures. This will automatically import
# Trigger an import on $CWD/signatures/. This will automatically import
# recursively down the various directories through the use of
# enumerate_plugins(), which the Cuckoo Community adheres to. For this to
# work we temporarily insert the CWD in Python's path.