Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fleetctl: determine job state to be changed more accurately
So far assertUnitState() has determined whether a unit's job state is to be changed, simply by comparing current unit state with the target unit state. That's actually not always correct, as it's unnecessary to do that also for downgrading states. (e.g. launched -> loaded) To run it only when upgrading states (e.g. loaded -> launched), introduce a helper jsToBeChanged(), which returns true only the target state is a more activated one than the current state. Use jsToBeChanged() instead of simple comparison in assertUnitState().
- Loading branch information