Skip to content
GitLab
Menu
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
Show whitespace changes
Inline
Side-by-side
feudal/backend/models/deployments.py
View file @
34fb6521
...
@@ -121,6 +121,7 @@ class Deployment(PolymorphicModel):
...
@@ -121,6 +121,7 @@ class Deployment(PolymorphicModel):
self
.
publish_to_user
()
self
.
publish_to_user
()
# deprecated
# Deployment.user_deploy
# Deployment.user_deploy
def
user_deploy
(
self
):
def
user_deploy
(
self
):
LOGGER
.
debug
(
self
.
msg
(
'user_deploy'
))
LOGGER
.
debug
(
self
.
msg
(
'user_deploy'
))
...
@@ -132,6 +133,7 @@ class Deployment(PolymorphicModel):
...
@@ -132,6 +133,7 @@ class Deployment(PolymorphicModel):
self
.
publish_to_client
()
self
.
publish_to_client
()
# deprecated
# Deployment.user_remove
# Deployment.user_remove
def
user_remove
(
self
):
def
user_remove
(
self
):
LOGGER
.
debug
(
self
.
msg
(
'user_remove'
))
LOGGER
.
debug
(
self
.
msg
(
'user_remove'
))
...
@@ -147,14 +149,20 @@ class Deployment(PolymorphicModel):
...
@@ -147,14 +149,20 @@ class Deployment(PolymorphicModel):
# These will be deployed again when their DepState realises the error
# These will be deployed again when their DepState realises the error
self
.
publish_to_client
()
self
.
publish_to_client
()
# this did not make sense
# call when you changed Deployment.state_target
# # we only publish to the clients if allowed
def
target_changed
(
self
):
# # we are not allowed to publish a removal if another deployment for our
LOGGER
.
debug
(
self
.
msg
(
'target_changed: {}'
.
format
(
self
.
state_target
)))
# # DeploymentStates exists and has the target DEPLOYED
# if can_publish:
for
item
in
self
.
states
.
filter
(
~
Q
(
state
=
self
.
state_target
)):
# self.publish()
item
.
dep_target_changed
()
# else:
# self.publish_to_user()
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
):
def
user_credential_added
(
self
,
key
):
for
item
in
self
.
states
.
all
():
for
item
in
self
.
states
.
all
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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