summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadek Novacek <rnovacek@redhat.com>2014-05-09 14:25:24 +0200
committerRadek Novacek <rnovacek@redhat.com>2014-05-13 08:24:44 +0200
commitb619fa3610d0920f6b1cec737c9ff2b7b4839c94 (patch)
tree859b0ecdb34742a63e6b5fe2b71558341ae1fcfa
parent28aed3c2c360b84762f76b322e9fc80bd74c036b (diff)
downloadopenlmi-providers-b619fa3610d0920f6b1cec737c9ff2b7b4839c94.tar.gz
openlmi-providers-b619fa3610d0920f6b1cec737c9ff2b7b4839c94.tar.xz
openlmi-providers-b619fa3610d0920f6b1cec737c9ff2b7b4839c94.zip
account: use defaultdict instead of Counter
Counter is not present in python <= 2.6, so replace it with defaultdict.
-rw-r--r--src/account/test/common.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/account/test/common.py b/src/account/test/common.py
index 639fb61..95abd38 100644
--- a/src/account/test/common.py
+++ b/src/account/test/common.py
@@ -26,7 +26,7 @@ import os
import tempfile
import string
import subprocess
-from collections import Counter
+from collections import defaultdict
from collections import OrderedDict
import methods
@@ -99,7 +99,7 @@ class PasswdFile():
"""
Find dups in fields that should be unique
"""
- dups = Counter()
+ dups = defaultdict(int)
for field in self.options['unique']:
if not methods.field_is_unique(field, self.users):
dups[field] += 1