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

framework/config: Fix JobSpec.from_pod

This commit is contained in:
Brendan Jackman 2017-11-06 13:01:46 +00:00 committed by setrofim
parent 95e9d14f9d
commit 2cd0c1a3f1

View File

@ -511,8 +511,8 @@ class Configuration(object):
def from_pod(cls, pod): def from_pod(cls, pod):
instance = cls() instance = cls()
for cfg_point in cls.config_points: for cfg_point in cls.config_points:
if name in pod: if cfg_point.name in pod:
value = pod.pop(name) value = pod.pop(cfg_point.name)
if hasattr(cfg_point.kind, 'from_pod'): if hasattr(cfg_point.kind, 'from_pod'):
value = cfg_point.kind.from_pod(value) value = cfg_point.kind.from_pod(value)
cfg_point.set_value(instance, value) cfg_point.set_value(instance, value)
@ -922,7 +922,7 @@ class JobSpec(Configuration):
def from_pod(cls, pod): def from_pod(cls, pod):
job_id = pod.pop('id') job_id = pod.pop('id')
instance = super(JobSpec, cls).from_pod(pod) instance = super(JobSpec, cls).from_pod(pod)
instance['id'] = job_id instance.id = job_id
return instance return instance
@property @property