1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 20:09:11 +00:00

utils.misc.normalize: only normalize string keys.

This commit is contained in:
Sergei Trofimov 2015-08-10 10:42:20 +01:00
parent 75e4b7d2ae
commit ab45c4499f

View File

@ -393,8 +393,9 @@ def normalize(value, dict_type=dict):
if isinstance(value, dict):
normalized = dict_type()
for k, v in value.iteritems():
key = k.strip().lower().replace(' ', '_')
normalized[key] = normalize(v, dict_type)
if isinstance(k, basestring):
k = k.strip().lower().replace(' ', '_')
normalized[k] = normalize(v, dict_type)
return normalized
elif isinstance(value, list):
return [normalize(v, dict_type) for v in value]