Commit 52fe8717 authored by Emmanuel Garette's avatar Emmanuel Garette
Browse files

updated are list

parent 4cd71845
Pipeline #771 passed with stage
in 0 seconds
......@@ -107,22 +107,23 @@ class SaltRunner(ZephirCommonController):
command='saltutil.clear_cache')
@register_wamp('v1.server.configuration.updated', None)
async def configuration_update(self, server_id):
server = await self.call('v1.server.describe',
serverid=server_id,
configuration=True)
pillar_file_path = '/srv/pillar/pillars_{0}.sls'.format(server_id)
with open(pillar_file_path + '.tmp', 'w') as fh:
if json.loads(server['configuration']):
yaml.dump(json.loads(server['configuration']), fh, allow_unicode=True)
else:
yaml.dump({}, fh)
if isfile(pillar_file_path):
remove(pillar_file_path)
rename(pillar_file_path + '.tmp', pillar_file_path)
self.pillar_clear_cache(str(server_id))
async def configuration_update(self, servers_id):
for server_id in servers_id:
server = await self.call('v1.server.describe',
serverid=server_id,
configuration=True)
pillar_file_path = '/srv/pillar/pillars_{0}.sls'.format(server_id)
with open(pillar_file_path + '.tmp', 'w') as fh:
if json.loads(server['configuration']):
yaml.dump(json.loads(server['configuration']), fh, allow_unicode=True)
else:
yaml.dump({}, fh)
if isfile(pillar_file_path):
remove(pillar_file_path)
rename(pillar_file_path + '.tmp', pillar_file_path)
self.pillar_clear_cache(str(server_id))
@register_wamp('v1.execution.salt.configuration.deploy',
notification_uri='v1.execution.salt.configuration.deploy-scheduled')
......
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