8416: Don't catch exception from search_for, potentially hides exceptions we
[arvados.git] / services / nodemanager / arvnodeman / computenode / driver / __init__.py
index b6bc8b99182e57390bfc248679d5d78654062a04..9bdcc5f7a123e5a0d15dc237e2144bfe5358fdb4 100644 (file)
@@ -148,15 +148,12 @@ class BaseComputeNodeDriver(RetryMixin):
             # loop forever because subsequent create_node attempts will fail
             # due to node name collision.  So check if the node we intended to
             # create shows up in the cloud node list and return it if found.
-            try:
-                node = self.search_for(kwargs['name'], 'list_nodes', self._name_key)
-                if node:
-                    return node
-            except:
-                # Ignore possible exception from find_node in favor of
-                # re-raising the original create_node exception.
-                pass
-            raise
+            node = self.search_for(kwargs['name'], 'list_nodes', self._name_key)
+            if node:
+                return node
+            else:
+                # something else went wrong, re-raise the exception
+                raise
 
     def post_create_node(self, cloud_node):
         # ComputeNodeSetupActor calls this method after the cloud node is