diff --git a/doc/source/contributors/create/examples/resource/fake_service.py b/doc/source/contributors/create/examples/resource/fake_service.py index 5d1bfb58..9524b967 100644 --- a/doc/source/contributors/create/examples/resource/fake_service.py +++ b/doc/source/contributors/create/examples/resource/fake_service.py @@ -1,6 +1,6 @@ # Apache 2 header omitted for brevity -from openstack.auth import service_filter +from openstack import service_filter class FakeService(service_filter.ServiceFilter): diff --git a/doc/source/users/service_filter.rst b/doc/source/users/service_filter.rst index bd491a13..60910ce6 100644 --- a/doc/source/users/service_filter.rst +++ b/doc/source/users/service_filter.rst @@ -1,10 +1,10 @@ ServiceFilter ============== -.. automodule:: openstack.auth.service_filter +.. automodule:: openstack.service_filter ServiceFilter object -------------------- -.. autoclass:: openstack.auth.service_filter.ServiceFilter +.. autoclass:: openstack.service_filter.ServiceFilter :members: diff --git a/openstack/auth/base.py b/openstack/auth/base.py index b506ef42..2eac4170 100644 --- a/openstack/auth/base.py +++ b/openstack/auth/base.py @@ -71,7 +71,7 @@ class BaseAuthPlugin(object): :param transport: Authenticator may need to make HTTP calls. :type transport: :class:`~openstack.transport.Transport` :param service: Filter to identify the desired service. - :type service: :class:`~openstack.auth.service_filter.ServiceFilter` + :type service: :class:`~openstack.service_filter.ServiceFilter` :returns string: The base URL that will be used to talk to the required service or None if not available. @@ -84,7 +84,7 @@ class BaseAuthPlugin(object): :param transport: Authenticator may need to make HTTP calls. :type transport: :class:`~openstack.transport.Transport` :param service: Filter to identify the desired service. - :type service: :class:`~openstack.auth.service_filter.ServiceFilter` + :type service: :class:`~openstack.service_filter.ServiceFilter` :returns list: Returns list of versions that match the filter. """ diff --git a/openstack/auth/identity/base.py b/openstack/auth/identity/base.py index e807c612..3e37c820 100644 --- a/openstack/auth/identity/base.py +++ b/openstack/auth/identity/base.py @@ -141,7 +141,7 @@ class BaseIdentityPlugin(base.BaseAuthPlugin): :param transport: A transport object for the authenticator. :type transport: :class:`~openstack.transport.Transport` :param service: The filter to identify the desired service. - :type service: :class:`~openstack.auth.service_filter.ServiceFilter` + :type service: :class:`~openstack.service_filter.ServiceFilter` :raises HttpError: An error from an invalid HTTP response. @@ -156,7 +156,7 @@ class BaseIdentityPlugin(base.BaseAuthPlugin): :param Transport transport: Authenticator may need to make HTTP calls. :type transport: :class:`~openstack.transport.Transport` :param ServiceFilter service: Filter to identify the desired service. - :type service: :class:`~openstack.auth.service_filter.ServiceFilter` + :type service: :class:`~openstack.service_filter.ServiceFilter` :returns list: Returns list of versions that match the filter. """ diff --git a/openstack/block_store/block_store_service.py b/openstack/block_store/block_store_service.py index af9b9b62..586c3d1c 100644 --- a/openstack/block_store/block_store_service.py +++ b/openstack/block_store/block_store_service.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.auth import service_filter +from openstack import service_filter class BlockStoreService(service_filter.ServiceFilter): diff --git a/openstack/cluster/cluster_service.py b/openstack/cluster/cluster_service.py index e65933d9..7b6eb5d1 100644 --- a/openstack/cluster/cluster_service.py +++ b/openstack/cluster/cluster_service.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.auth import service_filter +from openstack import service_filter class ClusterService(service_filter.ServiceFilter): diff --git a/openstack/compute/compute_service.py b/openstack/compute/compute_service.py index 5fa3a0c4..a27139a6 100644 --- a/openstack/compute/compute_service.py +++ b/openstack/compute/compute_service.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.auth import service_filter +from openstack import service_filter class ComputeService(service_filter.ServiceFilter): diff --git a/openstack/database/database_service.py b/openstack/database/database_service.py index 72ae358f..4b7c7b3f 100644 --- a/openstack/database/database_service.py +++ b/openstack/database/database_service.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.auth import service_filter +from openstack import service_filter class DatabaseService(service_filter.ServiceFilter): diff --git a/openstack/identity/identity_service.py b/openstack/identity/identity_service.py index ae32f8d4..4bcfafa5 100644 --- a/openstack/identity/identity_service.py +++ b/openstack/identity/identity_service.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.auth import service_filter +from openstack import service_filter class IdentityService(service_filter.ServiceFilter): diff --git a/openstack/image/image_service.py b/openstack/image/image_service.py index c3b1876f..3fb21cee 100644 --- a/openstack/image/image_service.py +++ b/openstack/image/image_service.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.auth import service_filter +from openstack import service_filter class ImageService(service_filter.ServiceFilter): diff --git a/openstack/key_management/key_management_service.py b/openstack/key_management/key_management_service.py index 6b10175a..9af5fe60 100644 --- a/openstack/key_management/key_management_service.py +++ b/openstack/key_management/key_management_service.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.auth import service_filter +from openstack import service_filter class KeyManagementService(service_filter.ServiceFilter): diff --git a/openstack/message/message_service.py b/openstack/message/message_service.py index fe0e8c51..32f827c1 100644 --- a/openstack/message/message_service.py +++ b/openstack/message/message_service.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.auth import service_filter +from openstack import service_filter class MessageService(service_filter.ServiceFilter): diff --git a/openstack/metric/metric_service.py b/openstack/metric/metric_service.py index 9bcaf0f5..b18153fb 100644 --- a/openstack/metric/metric_service.py +++ b/openstack/metric/metric_service.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.auth import service_filter +from openstack import service_filter class MetricService(service_filter.ServiceFilter): diff --git a/openstack/network/network_service.py b/openstack/network/network_service.py index 1e6c4379..8383c034 100644 --- a/openstack/network/network_service.py +++ b/openstack/network/network_service.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.auth import service_filter +from openstack import service_filter class NetworkService(service_filter.ServiceFilter): diff --git a/openstack/object_store/object_store_service.py b/openstack/object_store/object_store_service.py index 7aece80e..1f58b97c 100644 --- a/openstack/object_store/object_store_service.py +++ b/openstack/object_store/object_store_service.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.auth import service_filter +from openstack import service_filter class ObjectStoreService(service_filter.ServiceFilter): diff --git a/openstack/orchestration/orchestration_service.py b/openstack/orchestration/orchestration_service.py index 0f70996c..930e5b9a 100644 --- a/openstack/orchestration/orchestration_service.py +++ b/openstack/orchestration/orchestration_service.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.auth import service_filter +from openstack import service_filter class OrchestrationService(service_filter.ServiceFilter): diff --git a/openstack/auth/service_filter.py b/openstack/service_filter.py similarity index 96% rename from openstack/auth/service_filter.py rename to openstack/service_filter.py index e7430e79..1d9a0977 100644 --- a/openstack/auth/service_filter.py +++ b/openstack/service_filter.py @@ -11,7 +11,7 @@ # under the License. """ -The :class:`~openstack.auth.service_filter.ServiceFilter` is the base class +The :class:`~openstack.service_filter.ServiceFilter` is the base class for service identifiers and user service preferences. Each :class:`~openstack.resource.Resource` has a service identifier to associate the resource with a service. An example of a service identifier @@ -24,7 +24,7 @@ filter to match a service. Examples -------- -The :class:`~openstack.auth.service_filter.ServiceFilter` class can be built +The :class:`~openstack.service_filter.ServiceFilter` class can be built with a service type, interface, region, name, and version. Create a service filter @@ -33,7 +33,7 @@ Create a service filter Create a compute service and service preference. Join the services and match:: - from openstack.auth import service_filter + from openstack import service_filter from openstack.compute import compute_service default = compute_service.ComputeService() preference = service_filter.ServiceFilter('compute', version='v2') @@ -111,7 +111,7 @@ class ServiceFilter(object): the default service identifier. :param default: Default service identifier from the resource. - :type default: :class:`~openstack.auth.service_filter.ServiceFilter` + :type default: :class:`~openstack.service_filter.ServiceFilter` """ if default.version == self.UNVERSIONED: version = default.version diff --git a/openstack/session.py b/openstack/session.py index 34612407..c22145bb 100644 --- a/openstack/session.py +++ b/openstack/session.py @@ -91,7 +91,7 @@ class Session(object): :param str path: Path relative to service base url. :param service: a service filter for the authenticator to determine the correct endpoint to use. - :type service: :class:`~openstack.auth.service_filter.ServiceFilter` + :type service: :class:`~openstack.service_filter.ServiceFilter` :param bool authenticate: A flag that indicates if a token should be attached to the request. This parameter defaults to true. :param kwargs: The remaining arguments are passed to the transport @@ -110,7 +110,7 @@ class Session(object): :param string path: Path relative to authentictor base url. :param string method: The http method to use. (eg. 'GET', 'POST'). :param service: Object that filters service to the authenticator. - :type service: :class:`~openstack.auth.service_filter.ServiceFilter` + :type service: :class:`~openstack.service_filter.ServiceFilter` :param bool authenticate: True if a token should be attached :param kwargs: any other parameter that can be passed to transport and authenticator. diff --git a/openstack/telemetry/telemetry_service.py b/openstack/telemetry/telemetry_service.py index ffd1a40f..6b0a9cc9 100644 --- a/openstack/telemetry/telemetry_service.py +++ b/openstack/telemetry/telemetry_service.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.auth import service_filter +from openstack import service_filter class TelemetryService(service_filter.ServiceFilter): diff --git a/openstack/tests/functional/base.py b/openstack/tests/functional/base.py index 38d56634..c9765307 100644 --- a/openstack/tests/functional/base.py +++ b/openstack/tests/functional/base.py @@ -14,9 +14,9 @@ import os import time import unittest -from openstack.auth import service_filter from openstack import connection from openstack import exceptions +from openstack import service_filter def requires_service(**kwargs): @@ -31,7 +31,7 @@ def requires_service(**kwargs): ... :param kwargs: The kwargs needed to create a - :class:`~openstack.auth.service_filter.ServiceFilter`. + :class:`~openstack.service_filter.ServiceFilter`. :returns: The test result if the test is executed. :raises: SkipTest, which is handled by the test runner. diff --git a/openstack/tests/unit/auth/test_service_catalog.py b/openstack/tests/unit/auth/test_service_catalog.py index f29dc2f9..15d71020 100644 --- a/openstack/tests/unit/auth/test_service_catalog.py +++ b/openstack/tests/unit/auth/test_service_catalog.py @@ -13,13 +13,13 @@ import testtools from openstack.auth import service_catalog as catalog -from openstack.auth import service_filter from openstack.compute import compute_service from openstack import exceptions as exc from openstack.identity import identity_service from openstack.image import image_service from openstack.network import network_service from openstack.object_store import object_store_service +from openstack import service_filter from openstack.tests.unit.auth import common diff --git a/openstack/tests/unit/test_functional_base.py b/openstack/tests/unit/test_functional_base.py index 4f05ceac..35055183 100644 --- a/openstack/tests/unit/test_functional_base.py +++ b/openstack/tests/unit/test_functional_base.py @@ -39,12 +39,12 @@ class Test_requires_service(unittest.TestCase): decorated = base.requires_service(**kwargs)(self.sot.test_method) return decorated(self.sot) - @mock.patch("openstack.auth.service_filter.ServiceFilter") + @mock.patch("openstack.service_filter.ServiceFilter") def test_service_exists(self, mock_filter): self.assertEqual(self.return_value, self._test(**self.kwargs)) mock_filter.assert_called_with(**self.kwargs) - @mock.patch("openstack.auth.service_filter.ServiceFilter") + @mock.patch("openstack.service_filter.ServiceFilter") def test_service_doesnt_exist(self, mock_filter): exc = exceptions.EndpointNotFound self.sot.conn.authenticator.get_endpoint.side_effect = exc diff --git a/openstack/tests/unit/auth/test_service_filter.py b/openstack/tests/unit/test_service_filter.py similarity index 99% rename from openstack/tests/unit/auth/test_service_filter.py rename to openstack/tests/unit/test_service_filter.py index 6228ad9d..91e6d9b8 100644 --- a/openstack/tests/unit/auth/test_service_filter.py +++ b/openstack/tests/unit/test_service_filter.py @@ -13,9 +13,9 @@ import six import testtools -from openstack.auth import service_filter as filt from openstack import exceptions from openstack.identity import identity_service +from openstack import service_filter as filt class TestServiceFilter(testtools.TestCase): diff --git a/openstack/tests/unit/test_session.py b/openstack/tests/unit/test_session.py index 6710c4d3..49be4716 100644 --- a/openstack/tests/unit/test_session.py +++ b/openstack/tests/unit/test_session.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.auth import service_filter +from openstack import service_filter from openstack import session from openstack.tests.unit import base from openstack.tests.unit import fakes