Commit a21618ac authored by Lionel Morin's avatar Lionel Morin

Merge branch 'updated_list' into 'develop'

updated are list

See merge request !15
parents 17afe2c9 840d38ee
Pipeline #869 passed with stage
in 0 seconds
......@@ -110,24 +110,23 @@ class SaltRunner(ZephirCommonController):
client_mode="local")
@register_wamp('v1.server.configuration.updated', None)
async def configuration_update(self, server_id, deploy):
if not deploy:
return
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