Remove validation of state on state read property access

This should be done (and are done, but not with the best
exception messages) in a more appropriate place (in the
methods of the jobboard that mutate a job via some manner,
aka, in consume, claim, abandon, trash...).

Part of fix for bug 1452388

Change-Id: If29bc73cc6e9282ad35a50ce0041efc3ff8f71d9
This commit is contained in:
Joshua Harlow
2015-05-07 10:01:46 -07:00
parent 33badc9b9b
commit 51a82bbc21

View File

@@ -79,7 +79,6 @@ class ZookeeperJob(base.Job):
basename = k_paths.basename(self._path)
self._root = self._path[0:-len(basename)]
self._sequence = int(basename[len(board.JOB_PREFIX):])
self._last_state = None
@property
def lock_path(self):
@@ -174,11 +173,7 @@ class ZookeeperJob(base.Job):
@property
def state(self):
current_state = self._fetch_state()
if self._last_state is not None:
states.check_job_transition(self._last_state, current_state)
self._last_state = current_state
return current_state
return self._fetch_state()
def _fetch_state(self):
owner = self.board.find_owner(self)