Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
feudal
feudalBackend
Commits
34fb6521
Commit
34fb6521
authored
Dec 15, 2018
by
Lukas Burgey
Browse files
Change deployment target updating
parent
5602d6be
Changes
1
Hide whitespace changes
Inline
Side-by-side
feudal/backend/models/deployments.py
View file @
34fb6521
...
...
@@ -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
():
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment