Add backwards compat handling for FrozenJob

Change I9425ccf9c532e59b96040d182e2ffa3b5c3321be is not compatible
with a rolling restart because a second scheduler may try to write
a FrozenJob after reading one without these attributes.  Handle
this gracefully by not writing them out if they are not present.

Change-Id: I4fcae4ee81a09552c7c206afdf5b7ab700d860f5
This commit is contained in:
James E. Blair 2022-01-19 09:14:19 -08:00
parent dcd942bb8e
commit d304f4134f
1 changed files with 4 additions and 0 deletions

View File

@ -2020,6 +2020,10 @@ class FrozenJob(zkobject.ZKObject):
def serialize(self):
data = {}
for k in self.attributes:
# TODO: Backwards compat handling, remove after 5.0
if k == 'config_hash':
if not hasattr(self, k):
continue
v = getattr(self, k)
if k == 'nodeset':
v = v.toDict()