Commit d8e0dc17 authored by Guido Trotter's avatar Guido Trotter
Browse files

jqueue: simplify removal from _nodes

Somewhere we do try/del/except and somewhere just pop. Using pop
everywhere saves lines of code.
Signed-off-by: default avatarGuido Trotter <>
Reviewed-by: default avatarIustin Pop <>
parent 60bb8b5d
......@@ -621,10 +621,7 @@ class JobQueue(object):
if n.master_candidate)
# Remove master node
del self._nodes[self._my_hostname]
except KeyError:
self._nodes.pop(self._my_hostname, None)
# TODO: Check consistency across nodes
......@@ -734,11 +731,7 @@ class JobQueue(object):
@param node_name: the name of the node to remove
# The queue is removed by the "leave node" RPC call.
del self._nodes[node_name]
except KeyError:
self._nodes.pop(node_name, None)
def _CheckRpcResult(result, nodes, failmsg):
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