Commit 17afe2c9 authored by Lionel Morin's avatar Lionel Morin

Merge branch 'feature/amelioration' into 'develop'

Feature/amelioration

See merge request !16
parents 4cd71845 e97541a2
Pipeline #857 passed with stage
in 0 seconds
......@@ -105,9 +105,14 @@ class SaltRunner(ZephirCommonController):
def pillar_clear_cache(self, minion_pattern):
self.executor.exec_command(minion_pattern=minion_pattern,
command='saltutil.clear_cache')
self.executor.exec_command(minion_pattern=minion_pattern,
command='saltutil.sync_all',
client_mode="local")
@register_wamp('v1.server.configuration.updated', None)
async def configuration_update(self, server_id):
async def configuration_update(self, server_id, deploy):
if not deploy:
return
server = await self.call('v1.server.describe',
serverid=server_id,
configuration=True)
......@@ -167,6 +172,9 @@ class SaltRunner(ZephirCommonController):
@register_wamp('v1.execution.salt.environment.get', notification_uri=None)
async def get_environment(self, server_id):
server_id = str(server_id)
self.executor.exec_command(minion_pattern=str(server_id),
command='saltutil.sync_all',
client_mode="local")
return self.executor.exec_command(server_id,
'zephir.environment',
None,
......
......@@ -88,6 +88,13 @@ class SaltEvents():
server_id = int(server_id)
pub_options = PublishOptions(exclude_me=False)
self.wamp.publish('v1.execution.salt.master.event.start', server_id=server_id, options=pub_options)
if 'salt/job' in tag:
server_id = loads(event.data).get('data', {}).get('id')
datas = loads(event.data).get('data')
if 'fun_args' in datas and 'success' in datas:
if 'reconfigure' in datas['fun_args'] and datas['success'] == True:
self.wamp.publish('v1.execution.salt.master.event.ready', server_id=int(server_id))
# Based on https://github.com/tOkeshu/eventsource-parser
# Licensed under the Apache License, Version 2.0.
......
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