mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-20 20:09:11 +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:
|
||||
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']
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user