mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-22 04:49:00 +00:00
utils/types: When creating an enum also try to deserialize from POD
Allows for recreating an Enum from a full string representation of the Enum rather than just the name of the Enum.
This commit is contained in:
parent
0113940c85
commit
4f67cda89f
@ -635,7 +635,10 @@ def enum(args, start=0, step=1):
|
|||||||
if name == attr:
|
if name == attr:
|
||||||
return attr
|
return attr
|
||||||
|
|
||||||
raise ValueError('Invalid enum value: {}'.format(repr(name)))
|
try:
|
||||||
|
return Enum.from_pod(name)
|
||||||
|
except ValueError:
|
||||||
|
raise ValueError('Invalid enum value: {}'.format(repr(name)))
|
||||||
|
|
||||||
reserved = ['values', 'levels', 'names']
|
reserved = ['values', 'levels', 'names']
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user