cluster policy attach cannot work
The value of parsed_args.enabled must be changed from string to bool Change-Id: Icf4fb6d93db269ebfe828d57736563d20a90686d Closed-Bug: 1639706
This commit is contained in:
@@ -599,7 +599,7 @@ class TestClusterPolicyAttach(TestCluster):
|
||||
self.mock_client.cluster_attach_policy.assert_called_with(
|
||||
'my_cluster',
|
||||
'my_policy',
|
||||
enabled='True')
|
||||
enabled=True)
|
||||
|
||||
|
||||
class TestClusterPolicyDetach(TestCluster):
|
||||
|
||||
@@ -22,6 +22,7 @@ from openstack import exceptions as sdk_exc
|
||||
from osc_lib.command import command
|
||||
from osc_lib import exceptions as exc
|
||||
from osc_lib import utils
|
||||
from oslo_utils import strutils
|
||||
import six
|
||||
|
||||
from senlinclient.common.i18n import _
|
||||
@@ -545,7 +546,8 @@ class ClusterPolicyAttach(command.Command):
|
||||
senlin_client = self.app.client_manager.clustering
|
||||
|
||||
kwargs = {
|
||||
'enabled': parsed_args.enabled,
|
||||
'enabled': strutils.bool_from_string(parsed_args.enabled,
|
||||
strict=True),
|
||||
}
|
||||
|
||||
resp = senlin_client.cluster_attach_policy(parsed_args.cluster,
|
||||
|
||||
Reference in New Issue
Block a user