Commit 8e00939c authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Maintain node list in job queue

The code makes sure not to include the master in the list.

Reviewed-by: iustinp
parent 9113300d
...@@ -291,7 +291,13 @@ class JobQueue(object): ...@@ -291,7 +291,13 @@ class JobQueue(object):
" check in jstore and here") " check in jstore and here")
# Get initial list of nodes # Get initial list of nodes
self._nodes = self.context.cfg.GetNodeList() self._nodes = set(self.context.cfg.GetNodeList())
# Remove master node
try:
self._nodes.remove(self._my_hostname)
except ValueError:
pass
# TODO: Check consistency across nodes # TODO: Check consistency across nodes
...@@ -333,9 +339,15 @@ class JobQueue(object): ...@@ -333,9 +339,15 @@ class JobQueue(object):
except ValueError: except ValueError:
pass pass
def _WriteAndReplicateFileUnlocked(self, file_name, data):
"""Writes a file locally and then replicates it to all nodes.
"""
utils.WriteFile(file_name, data=data)
failed_nodes = 0 failed_nodes = 0
result = rpc.call_upload_file(nodes, file_name) result = rpc.call_upload_file(self._nodes, file_name)
for node in nodes: for node in self._nodes:
if not result[node]: if not result[node]:
failed_nodes += 1 failed_nodes += 1
logging.error("Copy of job queue file to node %s failed", node) logging.error("Copy of job queue file to node %s failed", node)
......
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