Commit 7fafc67b authored by lukas.burgey's avatar lukas.burgey

Publish more changes to the DepStates

parent 91feff66
......@@ -414,7 +414,6 @@ class DeploymentState(models.Model):
return state, created
# adds the deployment to our related deployments
def bind_to_deployment(self, deployment):
if not self.deployments.filter(id=deployment.id).exists():
......@@ -508,20 +507,20 @@ class DeploymentState(models.Model):
REJECTED: None, # client will not execute the deployment
FAILED: None, # the client will retry this deployment via polling
FAILED_PERMANENTLY: None, # the client will retry this deployment when it restarts
QUESTIONNAIRE: self.publish_to_user, # needs answers
QUESTIONNAIRE: None, # needs answers
},
NOT_DEPLOYED: {
DEPLOYED: [REMOVAL_PENDING, self.publish_to_user, self.publish_to_client], # needs to get removed
DEPLOYMENT_PENDING: [NOT_DEPLOYED, self.publish_to_user], # aborting a deployment
DEPLOYED: [REMOVAL_PENDING, self.publish_to_client], # needs to get removed
DEPLOYMENT_PENDING: NOT_DEPLOYED, # aborting a deployment
NOT_DEPLOYED: None, # already reached correct state
REMOVAL_PENDING: None, # already on the way to the correct state
# these four states indicate that the last deployment run was not successful
# we therefore can turn around an say that the we reached the NOT_DEPLOYED state
FAILED: [NOT_DEPLOYED, self.publish_to_user],
FAILED_PERMANENTLY: [NOT_DEPLOYED, self.publish_to_user],
REJECTED: [NOT_DEPLOYED, self.publish_to_user],
QUESTIONNAIRE: [NOT_DEPLOYED, self.publish_to_user],
FAILED: NOT_DEPLOYED,
FAILED_PERMANENTLY: NOT_DEPLOYED,
REJECTED: NOT_DEPLOYED,
QUESTIONNAIRE: NOT_DEPLOYED,
},
}
self._apply_transition(state_transitions)
......@@ -595,6 +594,8 @@ class DeploymentState(models.Model):
self.save()
self.publish_to_user() # always publish to the use when the state changes
def publish_to_user(self):
if self.user is None:
LOGGER.debug(self.msg('publish_to_user: User is None'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment