From 3990806d8c0ee7c9e15756a9945371f9f717e285 Mon Sep 17 00:00:00 2001 From: itsikkes Date: Thu, 26 May 2016 16:36:55 +0300 Subject: [PATCH] ignore empty strings in fixed address list empty address string is used in the sample config for empty strings touple, which shouldn't cause an exception --- chaos_monkey/network/range.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chaos_monkey/network/range.py b/chaos_monkey/network/range.py index 4fa2f423c..0dfcf69ad 100644 --- a/chaos_monkey/network/range.py +++ b/chaos_monkey/network/range.py @@ -67,5 +67,9 @@ class FixedRange(NetworkRange): return "" % (",".join(self._fixed_addresses)) def _get_range(self): - return [struct.unpack(">L", socket.inet_aton(address))[0] - for address in self._fixed_addresses] + address_range = [] + for address in self._fixed_addresses: + if not address: # Empty string + continue + address_range.append(struct.unpack(">L", socket.inet_aton(address))[0]) + return address_range