def run_state_change(change, deployer, state_persister):
 with change.eliot_action.context():
  context = DeferredContext(maybeDeferred(change.run, deployer=deployer, state_persister=state_persister))
  context.addActionFinish()
  return context.result

def run_state_change ( change , deployer , state_persister ) : with change . eliot_action . context ( ) : context = DeferredContext ( maybeDeferred ( change . run , deployer = deployer , state_persister = state_persister ) ) context . addActionFinish ( ) return context . result
apply the change to local state .