Commit 34fb6521 authored by Lukas Burgey's avatar Lukas Burgey

Change deployment target updating

parent 5602d6be
......@@ -121,6 +121,7 @@ class Deployment(PolymorphicModel):
self.publish_to_user()
# deprecated
# Deployment.user_deploy
def user_deploy(self):
LOGGER.debug(self.msg('user_deploy'))
......@@ -132,6 +133,7 @@ class Deployment(PolymorphicModel):
self.publish_to_client()
# deprecated
# Deployment.user_remove
def user_remove(self):
LOGGER.debug(self.msg('user_remove'))
......@@ -147,14 +149,20 @@ class Deployment(PolymorphicModel):
# These will be deployed again when their DepState realises the error
self.publish_to_client()
# this did not make sense
# # we only publish to the clients if allowed
# # we are not allowed to publish a removal if another deployment for our
# # DeploymentStates exists and has the target DEPLOYED
# if can_publish:
# self.publish()
# else:
# self.publish_to_user()
# call when you changed Deployment.state_target
def target_changed(self):
LOGGER.debug(self.msg('target_changed: {}'.format(self.state_target)))
for item in self.states.filter(~Q(state=self.state_target)):
item.dep_target_changed()
self.publish_to_user()
# publish if there are pending states
for item in self.states.all():
if item.is_pending or item.is_credential_pending:
self.publish_to_client()
return
def user_credential_added(self, key):
for item in self.states.all():
......
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