[ARVADOS] created: 8b5a707a7a84e7fe9391d9c066f6e08f326e22f7
Git user
git at public.curoverse.com
Wed Feb 24 09:55:19 EST 2016
at 8b5a707a7a84e7fe9391d9c066f6e08f326e22f7 (commit)
commit 8b5a707a7a84e7fe9391d9c066f6e08f326e22f7
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Tue Feb 9 11:36:37 2016 -0500
8416: Remove find_node and use existing search_for feature.
diff --git a/services/nodemanager/arvnodeman/computenode/driver/__init__.py b/services/nodemanager/arvnodeman/computenode/driver/__init__.py
index c98c95a..b6bc8b9 100644
--- a/services/nodemanager/arvnodeman/computenode/driver/__init__.py
+++ b/services/nodemanager/arvnodeman/computenode/driver/__init__.py
@@ -131,12 +131,9 @@ class BaseComputeNodeDriver(RetryMixin):
self.ping_host, arvados_node['uuid'],
arvados_node['info']['ping_secret'])
- def find_node(self, name):
- node = [n for n in self.list_nodes() if n.name == name]
- if node:
- return node[0]
- else:
- return None
+ @staticmethod
+ def _name_key(cloud_object):
+ return cloud_object.name
def create_node(self, size, arvados_node):
try:
@@ -152,7 +149,7 @@ class BaseComputeNodeDriver(RetryMixin):
# 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.find_node(kwargs['name'])
+ node = self.search_for(kwargs['name'], 'list_nodes', self._name_key)
if node:
return node
except:
diff --git a/services/nodemanager/arvnodeman/computenode/driver/ec2.py b/services/nodemanager/arvnodeman/computenode/driver/ec2.py
index d89c48e..991a298 100644
--- a/services/nodemanager/arvnodeman/computenode/driver/ec2.py
+++ b/services/nodemanager/arvnodeman/computenode/driver/ec2.py
@@ -75,9 +75,6 @@ class ComputeNodeDriver(BaseComputeNodeDriver):
self.real.ex_create_tags(cloud_node,
{'Name': arvados_node_fqdn(arvados_node)})
- def find_node(self, name):
- raise NotImplementedError("ec2.ComputeNodeDriver.find_node")
-
def list_nodes(self):
# Need to populate Node.size
nodes = super(ComputeNodeDriver, self).list_nodes()
diff --git a/services/nodemanager/arvnodeman/computenode/driver/gce.py b/services/nodemanager/arvnodeman/computenode/driver/gce.py
index c5bf0b8..bbabdd4 100644
--- a/services/nodemanager/arvnodeman/computenode/driver/gce.py
+++ b/services/nodemanager/arvnodeman/computenode/driver/gce.py
@@ -39,10 +39,6 @@ class ComputeNodeDriver(BaseComputeNodeDriver):
for dt in self.real.ex_list_disktypes()}
@staticmethod
- def _name_key(cloud_object):
- return cloud_object.name
-
- @staticmethod
def _object_link(cloud_object):
return cloud_object.extra.get('selfLink')
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list