Refactor deploy handler

This commit is contained in:
R. Richard 2019-08-26 13:13:15 +02:00
parent b141b27b36
commit e17535b8a2
1 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,8 @@
import logging
LOG = logging.getLogger(__name__)
class DeployHandler:
keys = ['deploy.start', 'process.restart']
@ -22,8 +27,7 @@ class DeployHandler:
})
def handle_process(self, message):
self.connector.send_message({
'key': 'deploy.finish',
'status': 'success' if 'error' not in message else 'error'
})
response = {'key': 'deploy.finish'}
if 'error' in message:
response['error'] = message['error']
self.connector.send_message(response)