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
5c441c24
Commit
5c441c24
authored
Aug 06, 2018
by
Lukas Burgey
Browse files
Begin to change the client api
parent
da18bf88
Changes
1
Hide whitespace changes
Inline
Side-by-side
feudal/backend/models/__init__.py
View file @
5c441c24
...
...
@@ -303,6 +303,20 @@ class DeploymentState(models.Model):
default
=
'deployed'
,
)
# credentials provided by the backend to the clients
@
property
def
credentials
(
self
):
# FIXME hacky
ssh_keys
=
[{
'name'
:
key
.
name
,
'value'
:
key
.
key
}
for
key
in
self
.
user
.
ssh_keys
.
all
()]
return
{
'ssh_key'
:
ssh_keys
}
@
property
def
user
(
self
):
return
self
.
deployment
.
user
...
...
@@ -423,7 +437,9 @@ class DeploymentState(models.Model):
def
publish_to_client
(
self
):
# mitigating circular dependencies here
from
.serializers.clients
import
DeploymentStateSerializer
msg
=
dumps
(
DeploymentStateSerializer
(
self
).
data
)
data
=
DeploymentStateSerializer
(
self
).
data
data
[
'credentials'
]
=
self
.
credentials
msg
=
dumps
(
data
)
if
self
.
service
is
not
None
:
RabbitMQInstance
.
load
().
publish_by_service
(
...
...
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