Directory removal moved to happen before self_delete call

This commit is contained in:
VakarisZ 2019-03-25 10:48:56 +02:00
parent d61c080848
commit fecfd138a0
1 changed files with 1 additions and 1 deletions

View File

@ -218,6 +218,7 @@ class InfectionMonkey(object):
self.send_log() self.send_log()
self._singleton.unlock() self._singleton.unlock()
utils.remove_monkey_dir()
InfectionMonkey.self_delete() InfectionMonkey.self_delete()
LOG.info("Monkey is shutting down") LOG.info("Monkey is shutting down")
@ -233,7 +234,6 @@ class InfectionMonkey(object):
if WormConfiguration.self_delete_in_cleanup \ if WormConfiguration.self_delete_in_cleanup \
and -1 == sys.executable.find('python'): and -1 == sys.executable.find('python'):
try: try:
utils.remove_monkey_dir()
if "win32" == sys.platform: if "win32" == sys.platform:
from _subprocess import SW_HIDE, STARTF_USESHOWWINDOW, CREATE_NEW_CONSOLE from _subprocess import SW_HIDE, STARTF_USESHOWWINDOW, CREATE_NEW_CONSOLE
startupinfo = subprocess.STARTUPINFO() startupinfo = subprocess.STARTUPINFO()