Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
EOLE
Zéphir
Services
Server Manager
Commits
55359791
Commit
55359791
authored
Mar 21, 2019
by
Matthieu Lamalle
Browse files
Correction on message v1.server.exec.command
parent
685b9f64
Pipeline
#345
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
scripts/controller
View file @
55359791
...
...
@@ -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, ...)
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment