Commit 840d38ee authored by Lionel Morin's avatar Lionel Morin
Browse files

Merge branch 'develop' into 'updated_list'

# Conflicts:
#   scripts/controller
parents 52fe8717 17afe2c9
Pipeline #867 passed with stage
in 0 seconds
......@@ -105,6 +105,9 @@ 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, servers_id):
......@@ -168,6 +171,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