Skip to content
Snippets Groups Projects
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 <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 60bb8b5d
No related branches found
No related tags found
No related merge requests found
...@@ -621,10 +621,7 @@ class JobQueue(object): ...@@ -621,10 +621,7 @@ class JobQueue(object):
if n.master_candidate) if n.master_candidate)
# Remove master node # Remove master node
try: self._nodes.pop(self._my_hostname, None)
del self._nodes[self._my_hostname]
except KeyError:
pass
# TODO: Check consistency across nodes # TODO: Check consistency across nodes
...@@ -734,11 +731,7 @@ class JobQueue(object): ...@@ -734,11 +731,7 @@ class JobQueue(object):
@param node_name: the name of the node to remove @param node_name: the name of the node to remove
""" """
try: self._nodes.pop(node_name, None)
# The queue is removed by the "leave node" RPC call.
del self._nodes[node_name]
except KeyError:
pass
@staticmethod @staticmethod
def _CheckRpcResult(result, nodes, failmsg): def _CheckRpcResult(result, nodes, failmsg):
......
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