Skip to content
Snippets Groups Projects
Commit ec5af888 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Read watcher pause using RPC, not directly


The master daemon should not directly read files written by the node
daemon. This patch adds a new RPC to read the watcher pause file and
changes the master code to use it.

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 7c4bd156
No related branches found
No related tags found
No related merge requests found
......@@ -6530,7 +6530,13 @@ class _ClusterQuery(_QueryBase):
drain_flag = NotImplemented
 
if query.CQ_WATCHER_PAUSE in self.requested_data:
watcher_pause = utils.ReadWatcherPauseFile(pathutils.WATCHER_PAUSEFILE)
master_name = lu.cfg.GetMasterNode()
result = lu.rpc.call_get_watcher_pause(master_name)
result.Raise("Can't retrieve watcher pause from master node '%s'" %
master_name)
watcher_pause = result.payload
else:
watcher_pause = NotImplemented
 
......
......@@ -505,6 +505,8 @@ _MISC_CALLS = [
("hvname", None, "Hypervisor name"),
("hvfull", None, "Parameters to be validated"),
], None, None, "Validate hypervisor params"),
("get_watcher_pause", SINGLE, None, constants.RPC_TMO_URGENT, [],
None, None, "Get watcher pause end"),
("set_watcher_pause", MULTI, None, constants.RPC_TMO_URGENT, [
("until", None, None),
], None, None, "Set watcher pause end"),
......
......@@ -827,6 +827,13 @@ class NodeRequestHandler(http.server.HttpServerHandler):
(values,) = params
return ssconf.WriteSsconfFiles(values)
@staticmethod
def perspective_get_watcher_pause(params):
"""Get watcher pause end.
"""
return utils.ReadWatcherPauseFile(pathutils.WATCHER_PAUSEFILE)
@staticmethod
def perspective_set_watcher_pause(params):
"""Set watcher pause.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment