Commit 55359791 authored by Matthieu Lamalle's avatar Matthieu Lamalle
Browse files

Correction on message v1.server.exec.command

parent 685b9f64
Pipeline #345 passed with stage
in 0 seconds
......@@ -79,28 +79,15 @@ class ServerRunner(ZephirCommonController):
return None
def get_profil_for_all(self, cursor, uri, message_arguments):
server_ok = False
serverselection_ok = False
server_role = self.get_profil_for_server(cursor, uri, message_arguments)
if server_role is None :
return None
for role in server_role:
if self.policy.enforce(role, uri, 'allowed'):
server_ok = True
if not server_ok:
return None
serverselection_role = self.get_profil_for_serverselection(cursor, uri, message_arguments)
if serverselection_role is None :
return None
for role in serverselection_role:
if self.policy.enforce(role, uri, 'allowed'):
serverselection_ok = True
if not serverselection_ok:
return None
return role
server_role = self.get_profil_for_server(cursor, uri, message_arguments)
if server_role is None :
return None
else:
return server_role
@register_wamp('v1.server.list', notification_uri=None, database=True)
async def list_servers(self, cursor, _session_user):
......@@ -259,7 +246,10 @@ class ServerRunner(ZephirCommonController):
reason=str(err))
@register_wamp('v1.server.exec.command', notification_uri='v1.server.executed', database=True, profil_adapter='get_profil_for_server')
async def exec_cmd_on_server(self, cursor,_session_user, server_id, command):
async def exec_cmd_on_server(self, cursor, _session_user, server_id, command):
return await self._exec_cmd_on_server(cursor, server_id, command)
async def _exec_cmd_on_server(self, cursor, server_id, command):
"""
Transfer command transmitted to automation (salt, ...)
"""
......
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