Commit 5c441c24 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Begin to change the client api

parent da18bf88
......@@ -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(
......
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