diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2013-07-10 20:01:22 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-07-10 20:03:16 +0200 |
commit | 53dbdda31ad342b113192c30399b2ec4eaca1f01 (patch) | |
tree | a5464aef387c83b2e57989478f7c9fafa4f4ca5b | |
parent | 149dcbae2d12587fb687b81e3a1a4631f04db4d7 (diff) | |
download | tools-53dbdda31ad342b113192c30399b2ec4eaca1f01.tar.gz tools-53dbdda31ad342b113192c30399b2ec4eaca1f01.tar.bz2 tools-53dbdda31ad342b113192c30399b2ec4eaca1f01.zip |
utils: handle None values in group_by0.2.1
-rw-r--r-- | hostinfo/utils.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hostinfo/utils.py b/hostinfo/utils.py index cfd8de3..379b9fa 100644 --- a/hostinfo/utils.py +++ b/hostinfo/utils.py @@ -2,6 +2,9 @@ def group_by(value, group, default=None, display_check=None, print_value=None): groups = {} + if value is None: + return groups + for elem in value: key = None if group in elem: |