From fc19da7427eabaaf6c673c9b8c8860ecc5f1263b Mon Sep 17 00:00:00 2001 From: daniel goldberg Date: Sun, 4 Sep 2016 13:45:49 +0300 Subject: [PATCH] Added grequests to hidden imports. Fixed dict lookup in monkeyfs --- chaos_monkey/monkey-linux.spec | 2 +- chaos_monkey/monkey.spec | 2 +- chaos_monkey/monkeyfs.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/chaos_monkey/monkey-linux.spec b/chaos_monkey/monkey-linux.spec index 16e88810d..5ebd9779e 100644 --- a/chaos_monkey/monkey-linux.spec +++ b/chaos_monkey/monkey-linux.spec @@ -7,7 +7,7 @@ a = Analysis(['main.py'], pathex=['.'], binaries=None, datas=None, - hiddenimports=['_cffi_backend'], + hiddenimports=['_cffi_backend','grequests'], hookspath=None, runtime_hooks=None, excludes=None, diff --git a/chaos_monkey/monkey.spec b/chaos_monkey/monkey.spec index 8f3418ecb..e233d64f5 100644 --- a/chaos_monkey/monkey.spec +++ b/chaos_monkey/monkey.spec @@ -3,7 +3,7 @@ import os import platform a = Analysis(['main.py'], pathex=['.'], - hiddenimports=['_cffi_backend', 'queue'], + hiddenimports=['_cffi_backend', 'queue','grequests'], hookspath=None, runtime_hooks=None) diff --git a/chaos_monkey/monkeyfs.py b/chaos_monkey/monkeyfs.py index 5e10688bf..dabd3a7eb 100644 --- a/chaos_monkey/monkeyfs.py +++ b/chaos_monkey/monkeyfs.py @@ -16,7 +16,7 @@ class VirtualFile(BytesIO): name = MONKEYFS_PREFIX + name self.name = name self._mode = mode - if VirtualFile._vfs.has_key(name): + if name in VirtualFile._vfs: super(VirtualFile, self).__init__(self._vfs[name]) else: super(VirtualFile, self).__init__('') @@ -31,7 +31,8 @@ class VirtualFile(BytesIO): @staticmethod def isfile(path): - return VirtualFile._vfs.has_key(path) + return path in VirtualFile._vfs + def getsize(path):