Commit d10404be authored by gwenael remond's avatar gwenael remond

Merge branch '1-impossible-de-deployer-la-configuration-d-un-serveur' into 'develop'

Resolve "Impossible de déployer la configuration d'un serveur"

Closes #1

See merge request !10
parents 1b1efdf4 9e59e95c
Pipeline #352 passed with stage
in 0 seconds
......@@ -288,7 +288,7 @@ class ServerRunner(ZephirCommonController):
return dico
@register_wamp('v1.server.exec.list', notification_uri=None, database=True, profil_adapter='get_profil_for_server')
async def exec_job_on_server(self, cursor,_session_user, server_id):
async def exec_job_on_server(self, cursor, _session_user, server_id):
automation, automation_command = self.server.get_automation_command(cursor, server_id)
if automation == 'salt':
results = await self.call('v1.execution.salt.job.list',
......@@ -301,13 +301,14 @@ class ServerRunner(ZephirCommonController):
return ret
@register_wamp('v1.server.exec.deploy', notification_uri=None, database=True)
async def exec_deploy(self, cursor, server_id):
return await self._exec_deploy_on_server(cursor, server_id)
async def exec_deploy(self, cursor, _session_user, server_id):
return await self._exec_deploy_on_server(cursor, _session_user, server_id)
async def _exec_deploy_on_server(self, cursor, server_id):
async def _exec_deploy_on_server(self, cursor, _session_user, server_id):
automation, automation_command = self.server.get_automation_command(cursor, server_id)
if automation == 'salt':
result = await self.call('v1.execution.salt.configuration.deploy',
_session_user=_session_user,
minion_pattern=str(server_id))
else:
raise Exception(_('Automation engine not supported: {}').format(automation))
......@@ -654,7 +655,7 @@ class ServerRunner(ZephirCommonController):
"""
servers = self.serverselection.describe_serverselection(cursor, serverselection_id)['serverselectionserversid']
ret = []
for server_id in servers:
try:
ret.append(await self._exec_deploy_on_server(cursor, server_id))
......
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