mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-21 20:38:57 +00:00
utils.misc.normalize: only normalize string keys.
This commit is contained in:
parent
75e4b7d2ae
commit
ab45c4499f
@ -393,8 +393,9 @@ def normalize(value, dict_type=dict):
|
|||||||
if isinstance(value, dict):
|
if isinstance(value, dict):
|
||||||
normalized = dict_type()
|
normalized = dict_type()
|
||||||
for k, v in value.iteritems():
|
for k, v in value.iteritems():
|
||||||
key = k.strip().lower().replace(' ', '_')
|
if isinstance(k, basestring):
|
||||||
normalized[key] = normalize(v, dict_type)
|
k = k.strip().lower().replace(' ', '_')
|
||||||
|
normalized[k] = normalize(v, dict_type)
|
||||||
return normalized
|
return normalized
|
||||||
elif isinstance(value, list):
|
elif isinstance(value, list):
|
||||||
return [normalize(v, dict_type) for v in value]
|
return [normalize(v, dict_type) for v in value]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user