Remove cluster-policy-enable/disable

The cluster-policy-enable and cluster-policy-disable APIs are now
useless since we have removed almost all other properties from a
cluster-policy binding. The enable/disable logic has better be done
through the cluster-policy-update operation which is more generic than
these two. So we have deleted them from senlin-api and sdk.

This patch adapts the client to this change.

Change-Id: I3c3a58ab7e75faec21400bbbad0b5e8420790d51
This commit is contained in:
tengqm 2016-01-15 02:41:11 -05:00
parent 9118fff840
commit 6cf6c81222
2 changed files with 0 additions and 44 deletions

View File

@ -1036,30 +1036,6 @@ class ShellTest(testtools.TestCase):
service.cluster_update_policy.assert_called_once_with('C1', **kwargs)
def test_do_cluster_policy_enable(self):
args = {
'id': 'CC',
'policy': 'PP'
}
args = self._make_args(args)
service = mock.Mock()
resp = {'action': 'action_id'}
service.cluster_enable_policy.return_value = resp
sh.do_cluster_policy_enable(service, args)
service.cluster_enable_policy.assert_called_once_with('CC', 'PP')
def test_do_cluster_policy_disable(self):
args = {
'id': 'CC',
'policy': 'PP'
}
args = self._make_args(args)
service = mock.Mock()
resp = {'action': 'action_id'}
service.cluster_disable_policy.return_value = resp
sh.do_cluster_policy_disable(service, args)
service.cluster_disable_policy.assert_called_once_with('CC', 'PP')
@mock.patch.object(utils, 'print_list')
def test_do_node_list(self, mock_print):
service = mock.Mock()

View File

@ -784,26 +784,6 @@ def do_cluster_policy_update(service, args):
print('Request accepted by action: %s' % resp['action'])
@utils.arg('-p', '--policy', metavar='<POLICY>', required=True,
help=_('ID or name of policy to be enabled.'))
@utils.arg('id', metavar='<NAME or ID>',
help=_('Name or ID of cluster to operate on.'))
def do_cluster_policy_enable(service, args):
"""Enable a policy on a cluster."""
resp = service.cluster_enable_policy(args.id, args.policy)
print('Request accepted by action: %s' % resp['action'])
@utils.arg('-p', '--policy', metavar='<POLICY>', required=True,
help=_('ID or name of policy to be disabled.'))
@utils.arg('id', metavar='<NAME or ID>',
help=_('Name or ID of cluster to operate on.'))
def do_cluster_policy_disable(service, args):
"""Disable a policy on a cluster."""
resp = service.cluster_disable_policy(args.id, args.policy)
print('Request accepted by action: %s' % resp['action'])
# NODES