Fixing issue when information returned from ipset isn't in the format we expect and it causes an exception.

This commit is contained in:
Gareth J. Greenaway 2015-08-25 16:11:14 -07:00
parent 7a58878ea8
commit f0c6090c7e

View file

@ -510,8 +510,10 @@ def _find_set_info(set):
setinfo = {}
_tmp = out['stdout'].split('\n')
for item in _tmp:
key, value = item.split(':', 1)
setinfo[key] = value[1:]
# Only split if item has a colon
if ':' in item:
key, value = item.split(':', 1)
setinfo[key] = value[1:]
return setinfo