diff --git a/senlinclient/osc/__init__.py b/senlinclient/osc/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/senlinclient/osc/v1/__init__.py b/senlinclient/osc/v1/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/senlinclient/osc/plugin.py b/senlinclient/plugin.py similarity index 100% rename from senlinclient/osc/plugin.py rename to senlinclient/plugin.py diff --git a/senlinclient/tests/unit/osc/__init__.py b/senlinclient/tests/unit/osc/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/senlinclient/tests/unit/osc/v1/__init__.py b/senlinclient/tests/unit/osc/v1/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/senlinclient/tests/unit/osc/v1/fakes.py b/senlinclient/tests/unit/osc/v1/fakes.py deleted file mode 100644 index 19a8363e..00000000 --- a/senlinclient/tests/unit/osc/v1/fakes.py +++ /dev/null @@ -1,33 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import mock - -from openstackclient.tests import utils -from senlinclient.tests.unit.osc import fakes - - -class FakeClusteringv1Client(object): - def __init__(self, **kwargs): - self.http_client = mock.Mock() - self.http_client.auth_token = kwargs['token'] - self.profiles = fakes.FakeResource(None, {}) - - -class TestClusteringv1(utils.TestCommand): - def setUp(self): - super(TestClusteringv1, self).setUp() - - self.app.client_manager.clustering = FakeClusteringv1Client( - token=fakes.AUTH_TOKEN, - auth_url=fakes.AUTH_URL - ) diff --git a/senlinclient/tests/unit/osc/fakes.py b/senlinclient/tests/unit/v1/fakes.py similarity index 89% rename from senlinclient/tests/unit/osc/fakes.py rename to senlinclient/tests/unit/v1/fakes.py index f6d47184..d591454b 100644 --- a/senlinclient/tests/unit/osc/fakes.py +++ b/senlinclient/tests/unit/v1/fakes.py @@ -11,10 +11,13 @@ # under the License. import json +import mock import requests import six import sys +from openstackclient.tests import utils + AUTH_TOKEN = "foobar" AUTH_URL = "http://0.0.0.0" @@ -158,3 +161,19 @@ class FakeResponse(requests.Response): self._content = json.dumps(data) if not isinstance(self._content, six.binary_type): self._content = self._content.encode() + + +class FakeClusteringv1Client(object): + def __init__(self, **kwargs): + self.http_client = mock.Mock() + self.http_client.auth_token = kwargs['token'] + self.profiles = FakeResource(None, {}) + + +class TestClusteringv1(utils.TestCommand): + def setUp(self): + super(TestClusteringv1, self).setUp() + + self.app.client_manager.clustering = FakeClusteringv1Client( + token=AUTH_TOKEN, auth_url=AUTH_URL + ) diff --git a/senlinclient/tests/unit/osc/v1/test_action.py b/senlinclient/tests/unit/v1/test_action.py similarity index 98% rename from senlinclient/tests/unit/osc/v1/test_action.py rename to senlinclient/tests/unit/v1/test_action.py index f2df79a1..21927dc4 100644 --- a/senlinclient/tests/unit/osc/v1/test_action.py +++ b/senlinclient/tests/unit/v1/test_action.py @@ -17,8 +17,8 @@ from openstack.cluster.v1 import action as sdk_action from openstack import exceptions as sdk_exc from openstackclient.common import exceptions as exc -from senlinclient.osc.v1 import action as osc_action -from senlinclient.tests.unit.osc.v1 import fakes +from senlinclient.tests.unit.v1 import fakes +from senlinclient.v1 import action as osc_action class TestAction(fakes.TestClusteringv1): diff --git a/senlinclient/tests/unit/osc/v1/test_build_info.py b/senlinclient/tests/unit/v1/test_build_info.py similarity index 92% rename from senlinclient/tests/unit/osc/v1/test_build_info.py rename to senlinclient/tests/unit/v1/test_build_info.py index 1bf8e585..ba787742 100644 --- a/senlinclient/tests/unit/osc/v1/test_build_info.py +++ b/senlinclient/tests/unit/v1/test_build_info.py @@ -14,8 +14,8 @@ import mock from openstack.cluster.v1 import build_info as sdk_build_info -from senlinclient.osc.v1 import build_info as osc_build_info -from senlinclient.tests.unit.osc.v1 import fakes +from senlinclient.tests.unit.v1 import fakes +from senlinclient.v1 import build_info as osc_build_info class TestBuildInfo(fakes.TestClusteringv1): diff --git a/senlinclient/tests/unit/osc/v1/test_cluster.py b/senlinclient/tests/unit/v1/test_cluster.py similarity index 99% rename from senlinclient/tests/unit/osc/v1/test_cluster.py rename to senlinclient/tests/unit/v1/test_cluster.py index 093417d0..6495ea06 100644 --- a/senlinclient/tests/unit/osc/v1/test_cluster.py +++ b/senlinclient/tests/unit/v1/test_cluster.py @@ -18,8 +18,8 @@ from openstack.cluster.v1 import cluster as sdk_cluster from openstack import exceptions as sdk_exc from openstackclient.common import exceptions as exc -from senlinclient.osc.v1 import cluster as osc_cluster -from senlinclient.tests.unit.osc.v1 import fakes +from senlinclient.tests.unit.v1 import fakes +from senlinclient.v1 import cluster as osc_cluster class TestCluster(fakes.TestClusteringv1): diff --git a/senlinclient/tests/unit/osc/v1/test_cluster_policy.py b/senlinclient/tests/unit/v1/test_cluster_policy.py similarity index 97% rename from senlinclient/tests/unit/osc/v1/test_cluster_policy.py rename to senlinclient/tests/unit/v1/test_cluster_policy.py index 2d3d3cf1..c0345528 100644 --- a/senlinclient/tests/unit/osc/v1/test_cluster_policy.py +++ b/senlinclient/tests/unit/v1/test_cluster_policy.py @@ -14,8 +14,8 @@ import mock from openstack.cluster.v1 import cluster_policy as sdk_cluster_policy -from senlinclient.osc.v1 import cluster_policy as osc_cluster_policy -from senlinclient.tests.unit.osc.v1 import fakes +from senlinclient.tests.unit.v1 import fakes +from senlinclient.v1 import cluster_policy as osc_cluster_policy class TestClusterPolicy(fakes.TestClusteringv1): diff --git a/senlinclient/tests/unit/osc/v1/test_event.py b/senlinclient/tests/unit/v1/test_event.py similarity index 98% rename from senlinclient/tests/unit/osc/v1/test_event.py rename to senlinclient/tests/unit/v1/test_event.py index 06eb4345..7cd2f6a4 100644 --- a/senlinclient/tests/unit/osc/v1/test_event.py +++ b/senlinclient/tests/unit/v1/test_event.py @@ -17,8 +17,8 @@ from openstack.cluster.v1 import event as sdk_event from openstack import exceptions as sdk_exc from openstackclient.common import exceptions as exc -from senlinclient.osc.v1 import event as osc_event -from senlinclient.tests.unit.osc.v1 import fakes +from senlinclient.tests.unit.v1 import fakes +from senlinclient.v1 import event as osc_event class TestEvent(fakes.TestClusteringv1): diff --git a/senlinclient/tests/unit/osc/v1/test_node.py b/senlinclient/tests/unit/v1/test_node.py similarity index 99% rename from senlinclient/tests/unit/osc/v1/test_node.py rename to senlinclient/tests/unit/v1/test_node.py index afdd2389..6bfdadaf 100644 --- a/senlinclient/tests/unit/osc/v1/test_node.py +++ b/senlinclient/tests/unit/v1/test_node.py @@ -18,8 +18,8 @@ from openstack.cluster.v1 import node as sdk_node from openstack import exceptions as sdk_exc from openstackclient.common import exceptions as exc -from senlinclient.osc.v1 import node as osc_node -from senlinclient.tests.unit.osc.v1 import fakes +from senlinclient.tests.unit.v1 import fakes +from senlinclient.v1 import node as osc_node class TestNode(fakes.TestClusteringv1): diff --git a/senlinclient/tests/unit/osc/v1/test_policy.py b/senlinclient/tests/unit/v1/test_policy.py similarity index 99% rename from senlinclient/tests/unit/osc/v1/test_policy.py rename to senlinclient/tests/unit/v1/test_policy.py index c6920dea..350a7d96 100644 --- a/senlinclient/tests/unit/osc/v1/test_policy.py +++ b/senlinclient/tests/unit/v1/test_policy.py @@ -18,8 +18,8 @@ from openstack.cluster.v1 import policy as sdk_policy from openstack import exceptions as sdk_exc from openstackclient.common import exceptions as exc -from senlinclient.osc.v1 import policy as osc_policy -from senlinclient.tests.unit.osc.v1 import fakes +from senlinclient.tests.unit.v1 import fakes +from senlinclient.v1 import policy as osc_policy class TestPolicy(fakes.TestClusteringv1): diff --git a/senlinclient/tests/unit/osc/v1/test_policy_type.py b/senlinclient/tests/unit/v1/test_policy_type.py similarity index 96% rename from senlinclient/tests/unit/osc/v1/test_policy_type.py rename to senlinclient/tests/unit/v1/test_policy_type.py index 84506f7d..956dc164 100644 --- a/senlinclient/tests/unit/osc/v1/test_policy_type.py +++ b/senlinclient/tests/unit/v1/test_policy_type.py @@ -16,8 +16,8 @@ from openstack.cluster.v1 import policy_type as sdk_policy_type from openstack import exceptions as sdk_exc from openstackclient.common import exceptions as exc -from senlinclient.osc.v1 import policy_type as osc_policy_type -from senlinclient.tests.unit.osc.v1 import fakes +from senlinclient.tests.unit.v1 import fakes +from senlinclient.v1 import policy_type as osc_policy_type class TestPolicyType(fakes.TestClusteringv1): diff --git a/senlinclient/tests/unit/osc/v1/test_profile.py b/senlinclient/tests/unit/v1/test_profile.py similarity index 99% rename from senlinclient/tests/unit/osc/v1/test_profile.py rename to senlinclient/tests/unit/v1/test_profile.py index b81d1ed4..d84e0d02 100644 --- a/senlinclient/tests/unit/osc/v1/test_profile.py +++ b/senlinclient/tests/unit/v1/test_profile.py @@ -19,8 +19,8 @@ from openstack import exceptions as sdk_exc from openstackclient.common import exceptions as exc from openstackclient.common import utils -from senlinclient.osc.v1 import profile as osc_profile -from senlinclient.tests.unit.osc.v1 import fakes +from senlinclient.tests.unit.v1 import fakes +from senlinclient.v1 import profile as osc_profile class TestProfile(fakes.TestClusteringv1): diff --git a/senlinclient/tests/unit/osc/v1/test_profile_type.py b/senlinclient/tests/unit/v1/test_profile_type.py similarity index 96% rename from senlinclient/tests/unit/osc/v1/test_profile_type.py rename to senlinclient/tests/unit/v1/test_profile_type.py index 9826d161..5a1fa0fa 100644 --- a/senlinclient/tests/unit/osc/v1/test_profile_type.py +++ b/senlinclient/tests/unit/v1/test_profile_type.py @@ -16,8 +16,8 @@ from openstack.cluster.v1 import profile_type as sdk_profile_type from openstack import exceptions as sdk_exc from openstackclient.common import exceptions as exc -from senlinclient.osc.v1 import profile_type as osc_profile_type -from senlinclient.tests.unit.osc.v1 import fakes +from senlinclient.tests.unit.v1 import fakes +from senlinclient.v1 import profile_type as osc_profile_type class TestProfileType(fakes.TestClusteringv1): diff --git a/senlinclient/tests/unit/osc/v1/test_receiver.py b/senlinclient/tests/unit/v1/test_receiver.py similarity index 99% rename from senlinclient/tests/unit/osc/v1/test_receiver.py rename to senlinclient/tests/unit/v1/test_receiver.py index 98fed37c..053bdc79 100644 --- a/senlinclient/tests/unit/osc/v1/test_receiver.py +++ b/senlinclient/tests/unit/v1/test_receiver.py @@ -18,8 +18,8 @@ from openstack.cluster.v1 import receiver as sdk_receiver from openstack import exceptions as sdk_exc from openstackclient.common import exceptions as exc -from senlinclient.osc.v1 import receiver as osc_receiver -from senlinclient.tests.unit.osc.v1 import fakes +from senlinclient.tests.unit.v1 import fakes +from senlinclient.v1 import receiver as osc_receiver class TestReceiver(fakes.TestClusteringv1): diff --git a/senlinclient/osc/v1/action.py b/senlinclient/v1/action.py similarity index 100% rename from senlinclient/osc/v1/action.py rename to senlinclient/v1/action.py diff --git a/senlinclient/osc/v1/build_info.py b/senlinclient/v1/build_info.py similarity index 100% rename from senlinclient/osc/v1/build_info.py rename to senlinclient/v1/build_info.py diff --git a/senlinclient/osc/v1/cluster.py b/senlinclient/v1/cluster.py similarity index 100% rename from senlinclient/osc/v1/cluster.py rename to senlinclient/v1/cluster.py diff --git a/senlinclient/osc/v1/cluster_policy.py b/senlinclient/v1/cluster_policy.py similarity index 100% rename from senlinclient/osc/v1/cluster_policy.py rename to senlinclient/v1/cluster_policy.py diff --git a/senlinclient/osc/v1/event.py b/senlinclient/v1/event.py similarity index 100% rename from senlinclient/osc/v1/event.py rename to senlinclient/v1/event.py diff --git a/senlinclient/osc/v1/node.py b/senlinclient/v1/node.py similarity index 100% rename from senlinclient/osc/v1/node.py rename to senlinclient/v1/node.py diff --git a/senlinclient/osc/v1/policy.py b/senlinclient/v1/policy.py similarity index 100% rename from senlinclient/osc/v1/policy.py rename to senlinclient/v1/policy.py diff --git a/senlinclient/osc/v1/policy_type.py b/senlinclient/v1/policy_type.py similarity index 100% rename from senlinclient/osc/v1/policy_type.py rename to senlinclient/v1/policy_type.py diff --git a/senlinclient/osc/v1/profile.py b/senlinclient/v1/profile.py similarity index 100% rename from senlinclient/osc/v1/profile.py rename to senlinclient/v1/profile.py diff --git a/senlinclient/osc/v1/profile_type.py b/senlinclient/v1/profile_type.py similarity index 100% rename from senlinclient/osc/v1/profile_type.py rename to senlinclient/v1/profile_type.py diff --git a/senlinclient/osc/v1/receiver.py b/senlinclient/v1/receiver.py similarity index 100% rename from senlinclient/osc/v1/receiver.py rename to senlinclient/v1/receiver.py diff --git a/setup.cfg b/setup.cfg index 0789a39a..65a456d1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,57 +27,57 @@ console_scripts = senlin = senlinclient.shell:main openstack.cli.extension = - clustering = senlinclient.osc.plugin + clustering = senlinclient.plugin openstack.clustering.v1 = - cluster_action_list = senlinclient.osc.v1.action:ListAction - cluster_action_show = senlinclient.osc.v1.action:ShowAction - cluster_build_info = senlinclient.osc.v1.build_info:BuildInfo - cluster_check = senlinclient.osc.v1.cluster:CheckCluster - cluster_create = senlinclient.osc.v1.cluster:CreateCluster - cluster_delete = senlinclient.osc.v1.cluster:DeleteCluster - cluster_event_list = senlinclient.osc.v1.event:ListEvent - cluster_event_show = senlinclient.osc.v1.event:ShowEvent - cluster_list = senlinclient.osc.v1.cluster:ListCluster - cluster_members_list = senlinclient.osc.v1.cluster:ClusterNodeList - cluster_members_add = senlinclient.osc.v1.cluster:ClusterNodeAdd - cluster_members_del = senlinclient.osc.v1.cluster:ClusterNodeDel - cluster_node_check = senlinclient.osc.v1.node:CheckNode - cluster_node_create = senlinclient.osc.v1.node:CreateNode - cluster_node_delete = senlinclient.osc.v1.node:DeleteNode - cluster_node_list = senlinclient.osc.v1.node:ListNode - cluster_node_recover = senlinclient.osc.v1.node:RecoverNode - cluster_node_show = senlinclient.osc.v1.node:ShowNode - cluster_node_update = senlinclient.osc.v1.node:UpdateNode - cluster_policy_attach = senlinclient.osc.v1.cluster:ClusterPolicyAttach - cluster_policy_binding_list = senlinclient.osc.v1.cluster_policy:ClusterPolicyList - cluster_policy_binding_show = senlinclient.osc.v1.cluster_policy:ClusterPolicyShow - cluster_policy_binding_update = senlinclient.osc.v1.cluster_policy:ClusterPolicyUpdate - cluster_policy_create = senlinclient.osc.v1.policy:CreatePolicy - cluster_policy_delete = senlinclient.osc.v1.policy:DeletePolicy - cluster_policy_detach = senlinclient.osc.v1.cluster:ClusterPolicyDetach - cluster_policy_list = senlinclient.osc.v1.policy:ListPolicy - cluster_policy_show = senlinclient.osc.v1.policy:ShowPolicy - cluster_policy_type_list = senlinclient.osc.v1.policy_type:PolicyTypeList - cluster_policy_type_show = senlinclient.osc.v1.policy_type:PolicyTypeShow - cluster_policy_update = senlinclient.osc.v1.policy:UpdatePolicy - cluster_profile_create = senlinclient.osc.v1.profile:CreateProfile - cluster_profile_delete = senlinclient.osc.v1.profile:DeleteProfile - cluster_profile_list = senlinclient.osc.v1.profile:ListProfile - cluster_profile_show = senlinclient.osc.v1.profile:ShowProfile - cluster_profile_type_list = senlinclient.osc.v1.profile_type:ProfileTypeList - cluster_profile_type_show = senlinclient.osc.v1.profile_type:ProfileTypeShow - cluster_profile_update = senlinclient.osc.v1.profile:UpdateProfile - cluster_receiver_create = senlinclient.osc.v1.receiver:CreateReceiver - cluster_receiver_delete = senlinclient.osc.v1.receiver:DeleteReceiver - cluster_receiver_list = senlinclient.osc.v1.receiver:ListReceiver - cluster_receiver_show = senlinclient.osc.v1.receiver:ShowReceiver - cluster_recover = senlinclient.osc.v1.cluster:RecoverCluster - cluster_resize = senlinclient.osc.v1.cluster:ResizeCluster - cluster_scale_in = senlinclient.osc.v1.cluster:ScaleInCluster - cluster_scale_out = senlinclient.osc.v1.cluster:ScaleOutCluster - cluster_show = senlinclient.osc.v1.cluster:ShowCluster - cluster_update = senlinclient.osc.v1.cluster:UpdateCluster + cluster_action_list = senlinclient.v1.action:ListAction + cluster_action_show = senlinclient.v1.action:ShowAction + cluster_build_info = senlinclient.v1.build_info:BuildInfo + cluster_check = senlinclient.v1.cluster:CheckCluster + cluster_create = senlinclient.v1.cluster:CreateCluster + cluster_delete = senlinclient.v1.cluster:DeleteCluster + cluster_event_list = senlinclient.v1.event:ListEvent + cluster_event_show = senlinclient.v1.event:ShowEvent + cluster_list = senlinclient.v1.cluster:ListCluster + cluster_members_list = senlinclient.v1.cluster:ClusterNodeList + cluster_members_add = senlinclient.v1.cluster:ClusterNodeAdd + cluster_members_del = senlinclient.v1.cluster:ClusterNodeDel + cluster_node_check = senlinclient.v1.node:CheckNode + cluster_node_create = senlinclient.v1.node:CreateNode + cluster_node_delete = senlinclient.v1.node:DeleteNode + cluster_node_list = senlinclient.v1.node:ListNode + cluster_node_recover = senlinclient.v1.node:RecoverNode + cluster_node_show = senlinclient.v1.node:ShowNode + cluster_node_update = senlinclient.v1.node:UpdateNode + cluster_policy_attach = senlinclient.v1.cluster:ClusterPolicyAttach + cluster_policy_binding_list = senlinclient.v1.cluster_policy:ClusterPolicyList + cluster_policy_binding_show = senlinclient.v1.cluster_policy:ClusterPolicyShow + cluster_policy_binding_update = senlinclient.v1.cluster_policy:ClusterPolicyUpdate + cluster_policy_create = senlinclient.v1.policy:CreatePolicy + cluster_policy_delete = senlinclient.v1.policy:DeletePolicy + cluster_policy_detach = senlinclient.v1.cluster:ClusterPolicyDetach + cluster_policy_list = senlinclient.v1.policy:ListPolicy + cluster_policy_show = senlinclient.v1.policy:ShowPolicy + cluster_policy_type_list = senlinclient.v1.policy_type:PolicyTypeList + cluster_policy_type_show = senlinclient.v1.policy_type:PolicyTypeShow + cluster_policy_update = senlinclient.v1.policy:UpdatePolicy + cluster_profile_create = senlinclient.v1.profile:CreateProfile + cluster_profile_delete = senlinclient.v1.profile:DeleteProfile + cluster_profile_list = senlinclient.v1.profile:ListProfile + cluster_profile_show = senlinclient.v1.profile:ShowProfile + cluster_profile_type_list = senlinclient.v1.profile_type:ProfileTypeList + cluster_profile_type_show = senlinclient.v1.profile_type:ProfileTypeShow + cluster_profile_update = senlinclient.v1.profile:UpdateProfile + cluster_receiver_create = senlinclient.v1.receiver:CreateReceiver + cluster_receiver_delete = senlinclient.v1.receiver:DeleteReceiver + cluster_receiver_list = senlinclient.v1.receiver:ListReceiver + cluster_receiver_show = senlinclient.v1.receiver:ShowReceiver + cluster_recover = senlinclient.v1.cluster:RecoverCluster + cluster_resize = senlinclient.v1.cluster:ResizeCluster + cluster_scale_in = senlinclient.v1.cluster:ScaleInCluster + cluster_scale_out = senlinclient.v1.cluster:ScaleOutCluster + cluster_show = senlinclient.v1.cluster:ShowCluster + cluster_update = senlinclient.v1.cluster:UpdateCluster [global] setup-hooks =