Commit db2203e0 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Add RPC for restricted commands



Expose the functionality to run restricted commands remotely via RPC.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 03c5291c
......@@ -479,6 +479,9 @@ _MISC_CALLS = [
], None, None, "Modify hosts file with name"),
("drbd_helper", MULTI, None, constants.RPC_TMO_URGENT, [],
None, None, "Gets DRBD helper"),
("restricted_command", MULTI, None, constants.RPC_TMO_SLOW, [
("cmd", None, "Command name"),
], None, None, "Runs restricted command"),
("run_oob", SINGLE, None, constants.RPC_TMO_NORMAL, [
("oob_program", None, None),
("command", None, None),
......
......@@ -810,6 +810,15 @@ class NodeRequestHandler(http.server.HttpServerHandler):
result = None
return result
@staticmethod
def perspective_restricted_command(params):
"""Runs a restricted command.
"""
(cmd, ) = params
return backend.RunRemoteCommand(cmd)
@staticmethod
def perspective_write_ssconf_files(params):
"""Write ssconf files.
......
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