From 8ff51b8398162d0453832f827657e6e62e294225 Mon Sep 17 00:00:00 2001 From: Ethan Lynn Date: Fri, 15 Jan 2016 11:23:11 +0800 Subject: [PATCH] Remove node join/leave from senlinclient Remove node join/leave from senlinclient Change-Id: Iad829753df418e5fe236d8d3f2a7c5151ce3cc02 --- senlinclient/tests/unit/v1/test_shell.py | 27 ------------------------ senlinclient/v1/client.py | 6 ------ senlinclient/v1/shell.py | 20 ------------------ 3 files changed, 53 deletions(-) diff --git a/senlinclient/tests/unit/v1/test_shell.py b/senlinclient/tests/unit/v1/test_shell.py index 569ee1d..a340242 100644 --- a/senlinclient/tests/unit/v1/test_shell.py +++ b/senlinclient/tests/unit/v1/test_shell.py @@ -1194,33 +1194,6 @@ class ShellTest(testtools.TestCase): service.update_node.assert_called_once_with('node_id', **attrs) mock_show.assert_called_once_with(service, 'node_id') - @mock.patch.object(sh, '_show_node') - def test_do_node_join(self, mock_show): - service = mock.Mock() - args = { - 'id': 'node1', - 'cluster': 'cluster1' - } - args = self._make_args(args) - resp = {'action': 'action_id'} - service.node_join.return_value = resp - sh.do_node_join(service, args) - service.node_join.assert_called_once_with('node1', 'cluster1') - mock_show.assert_called_once_with(service, 'node1') - - @mock.patch.object(sh, '_show_node') - def test_do_node_leave(self, mock_show): - service = mock.Mock() - args = { - 'id': 'node1', - } - args = self._make_args(args) - resp = {'action': 'action_id'} - service.node_leave.return_value = resp - sh.do_node_leave(service, args) - service.node_leave.assert_called_once_with('node1') - mock_show.assert_called_once_with(service, 'node1') - @mock.patch.object(utils, 'print_list') def test_do_event_list(self, mock_print): service = mock.Mock() diff --git a/senlinclient/v1/client.py b/senlinclient/v1/client.py index 01b3f31..57eb846 100644 --- a/senlinclient/v1/client.py +++ b/senlinclient/v1/client.py @@ -131,12 +131,6 @@ class Client(object): def delete_node(self, node, ignore_missing=True): return self.service.delete_node(node, ignore_missing) - def node_join(self, node, cluster): - return self.service.node_join(node, cluster) - - def node_leave(self, node): - return self.service.node_leave(node) - def receivers(self, **queries): return self.service.receivers(**queries) diff --git a/senlinclient/v1/shell.py b/senlinclient/v1/shell.py index e0b92ea..1f9eb1d 100644 --- a/senlinclient/v1/shell.py +++ b/senlinclient/v1/shell.py @@ -975,26 +975,6 @@ def do_node_update(service, args): _show_node(service, node.id) -@utils.arg('-c', '--cluster', required=True, - help=_('ID or name of cluster for node to join.')) -@utils.arg('id', metavar='', - help=_('Name or ID of node to operate on.')) -def do_node_join(service, args): - """Make node join the specified cluster.""" - resp = service.node_join(args.id, args.cluster) - print('Request accepted by action: %s' % resp['action']) - _show_node(service, args.id) - - -@utils.arg('id', metavar='', - help=_('Name or ID of node to operate on.')) -def do_node_leave(service, args): - """Make node leave its current cluster.""" - resp = service.node_leave(args.id) - print('Request accepted by action: %s' % resp['action']) - _show_node(service, args.id) - - # RECEIVERS