s/remove_node_from_/remove_nodes_from_/

This is to be consistent with add_nodes_to_cluster. This change also
renames the 'node' parameter to 'nodes' and improves a debug message.

Change-Id: I7054358d6a62248706fb2120e1aedb82b71541cd
This commit is contained in:
Simon Pasquier 2016-06-22 10:24:31 +02:00
parent a25b39c09b
commit 13d211abd7
5 changed files with 22 additions and 22 deletions

View File

@ -47,7 +47,7 @@ class TestNodesElasticsearchPlugin(api.ElasticsearchPluginApi):
target_node = {'slave-03': ['controller']}
# Remove a controller
self.helpers.remove_node_from_cluster(target_node)
self.helpers.remove_nodes_from_cluster(target_node)
self.check_plugin_online()
@ -86,7 +86,7 @@ class TestNodesElasticsearchPlugin(api.ElasticsearchPluginApi):
target_node = {'slave-04': ['compute', 'cinder']}
# Remove a compute node
self.helpers.remove_node_from_cluster(target_node)
self.helpers.remove_nodes_from_cluster(target_node)
self.check_plugin_online()
@ -128,7 +128,7 @@ class TestNodesElasticsearchPlugin(api.ElasticsearchPluginApi):
target_node = {'slave-07': self.settings.role_name}
# Remove an Elasticsearch-Kibana node
self.helpers.remove_node_from_cluster(target_node)
self.helpers.remove_nodes_from_cluster(target_node)
self.check_plugin_online()

View File

@ -160,7 +160,7 @@ class PluginHelper(object):
asserts.assert_is_not_none(
vip, "Failed to get the IP of {} server".format(vip_name))
logger.debug("Check that {} is ready".format(vip_name))
logger.debug("VIP '{0}': {1}".format(vip_name, vip))
return vip
def get_all_ready_nodes(self):
@ -219,11 +219,11 @@ class PluginHelper(object):
self.fuel_web.run_single_ostf_test(self.cluster_id, test_sets,
test_name, *args, **kwargs)
def add_nodes_to_cluster(self, node, redeploy=True, check_services=False):
def add_nodes_to_cluster(self, nodes, redeploy=True, check_services=False):
"""Add nodes to the cluster.
:param node: list of nodes with their roles.
:type: node: dict
:param nodes: list of nodes with their roles.
:type: nodes: dict
:param redeploy: whether to redeploy the cluster (default: True).
:type redeploy: boolean
:param check_services: run OSTF after redeploy (default: False).
@ -231,18 +231,18 @@ class PluginHelper(object):
"""
self.fuel_web.update_nodes(
self.cluster_id,
node,
nodes,
)
if redeploy:
self.fuel_web.deploy_cluster_wait(self.cluster_id,
check_services=check_services)
def remove_node_from_cluster(self, node, redeploy=True,
check_services=False):
def remove_nodes_from_cluster(self, nodes, redeploy=True,
check_services=False):
"""Remove nodes from the cluster.
:param node: list of nodes to remove from the cluster.
:type node: dict
:param nodes: list of nodes to remove from the cluster.
:type nodes: dict
:param redeploy: whether to redeploy the cluster (default: True).
:type redeploy: boolean
:param check_services: run OSTF after redeploy (default: False).
@ -250,7 +250,7 @@ class PluginHelper(object):
"""
self.fuel_web.update_nodes(
self.cluster_id,
node,
nodes,
pending_addition=False, pending_deletion=True,
)
if redeploy:

View File

@ -52,7 +52,7 @@ class TestNodesInfluxdbPlugin(api.InfluxdbPluginApi):
# nova has been keeping it in service list
# Remove controller
self.helpers.remove_node_from_cluster(manipulated_node)
self.helpers.remove_nodes_from_cluster(manipulated_node)
self.check_plugin_online()
@ -95,7 +95,7 @@ class TestNodesInfluxdbPlugin(api.InfluxdbPluginApi):
# nova has been keeping it in service list
# Remove compute
self.helpers.remove_node_from_cluster(manipulated_node)
self.helpers.remove_nodes_from_cluster(manipulated_node)
self.check_plugin_online()
@ -136,7 +136,7 @@ class TestNodesInfluxdbPlugin(api.InfluxdbPluginApi):
manipulated_node = {'slave-07': self.settings.role_name}
# Remove InfluxDB-Grafana node
self.helpers.remove_node_from_cluster(manipulated_node)
self.helpers.remove_nodes_from_cluster(manipulated_node)
self.check_plugin_online()

View File

@ -50,7 +50,7 @@ class TestLMAInfraAlertingPluginSystem(api.InfraAlertingPluginApi):
target_node = {'slave-02': ['controller']}
target_node_hostname = self.helpers.get_hostname_by_node_name(
target_node.keys()[0])
self.helpers.remove_node_from_cluster(target_node)
self.helpers.remove_nodes_from_cluster(target_node)
self.helpers.run_ostf(should_fail=1)
self.check_plugin_online()
self.check_node_in_nagios(target_node_hostname, False)
@ -89,7 +89,7 @@ class TestLMAInfraAlertingPluginSystem(api.InfraAlertingPluginApi):
target_node = {'slave-04': ['compute', 'cinder']}
target_node_hostname = self.helpers.get_hostname_by_node_name(
target_node.keys()[0])
self.helpers.remove_node_from_cluster(target_node, False, True)
self.helpers.remove_nodes_from_cluster(target_node, False, True)
self.helpers.run_ostf(should_fail=1)
self.check_plugin_online()
self.check_node_in_nagios(target_node_hostname, False)
@ -127,7 +127,7 @@ class TestLMAInfraAlertingPluginSystem(api.InfraAlertingPluginApi):
target_node = {'slave-05': self.settings.role_name}
target_node_hostname = self.helpers.get_hostname_by_node_name(
target_node.keys()[0])
self.helpers.remove_node_from_cluster(target_node)
self.helpers.remove_nodes_from_cluster(target_node)
self.helpers.run_ostf(should_fail=1)
self.check_plugin_online()
self.check_node_in_nagios(target_node_hostname, False)

View File

@ -47,7 +47,7 @@ class TestNodesToolchain(api.ToolchainApi):
manipulated_node = {'slave-03': ['controller']}
# Remove controller
self.helpers.remove_node_from_cluster(manipulated_node)
self.helpers.remove_nodes_from_cluster(manipulated_node)
self.check_plugins_online()
@ -84,7 +84,7 @@ class TestNodesToolchain(api.ToolchainApi):
manipulated_node = {'slave-04': ['compute', 'cinder']}
# Remove compute
self.helpers.remove_node_from_cluster(manipulated_node)
self.helpers.remove_nodes_from_cluster(manipulated_node)
self.check_plugins_online()
@ -126,7 +126,7 @@ class TestNodesToolchain(api.ToolchainApi):
self.check_nodes_count(3, manipulated_node_hostname, True)
# Remove node with StackLight roles
self.helpers.remove_node_from_cluster(manipulated_node)
self.helpers.remove_nodes_from_cluster(manipulated_node)
self.check_plugin_online()