Skip to content
Snippets Groups Projects
Commit 41362e70 authored by Guido Trotter's avatar Guido Trotter
Browse files

Simplify target generation in DistributeConfig

Currently we get the list of nodes, and for each one extract all its info, and
just to exclude it if the name matches ours. Since the list of nodes is a list
of names just use .remove() to exclude ourself from it, and use that list
directly.

Reviewed-by: iustinp
parent 8498462b
No related branches found
No related tags found
No related merge requests found
......@@ -544,15 +544,10 @@ class ConfigWriter:
nodelist = self.GetNodeList()
myhostname = self._my_hostname
tgt_list = []
for node in nodelist:
nodeinfo = self.GetNodeInfo(node)
if nodeinfo.name == myhostname:
continue
tgt_list.append(node)
nodelist.remove(myhostname)
result = rpc.call_upload_file(tgt_list, self._cfg_file)
for node in tgt_list:
result = rpc.call_upload_file(nodelist, self._cfg_file)
for node in nodelist:
if not result[node]:
logger.Error("copy of file %s to node %s failed" %
(self._cfg_file, node))
......
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