Esempio n. 1
0
 def test_removed_module(self):
     with warnings.catch_warnings(record=True) as capture:
         warnings.simplefilter("always")
         removals.removed_module(__name__)
     self.assertEqual(1, len(capture))
     w = capture[0]
     self.assertEqual(DeprecationWarning, w.category)
 def test_removed_module(self):
     with warnings.catch_warnings(record=True) as capture:
         warnings.simplefilter("always")
         removals.removed_module(__name__)
     self.assertEqual(1, len(capture))
     w = capture[0]
     self.assertEqual(DeprecationWarning, w.category)
Esempio n. 3
0
# Copyright 2015 IBM Corp.
#
#    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.

from debtcollector import removals

from oslo_messaging.notify.messaging import *  # noqa

# NOTE(mriedem): removal depends on how we can cap requirements in
# stable/liberty such that neutron does not try to load this
removals.removed_module(__name__,
                        oslo_messaging.notify.messaging.__name__,
                        removal_version='?')
Esempio n. 4
0
#    Copyright (C) 2015 Yahoo! Inc. All Rights Reserved.
#
#    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.

from debtcollector import moves
from debtcollector import removals

from taskflow.conductors.backends import impl_blocking

# TODO(harlowja): remove this module soon...
removals.removed_module(__name__,
                        replacement="the conductor entrypoints",
                        version="0.8", removal_version="?",
                        stacklevel=4)

# TODO(harlowja): remove this proxy/legacy class soon...
SingleThreadedConductor = moves.moved_class(
    impl_blocking.BlockingConductor, 'SingleThreadedConductor',
    __name__, version="0.8", removal_version="?")
Esempio n. 5
0
 def __init__(self, application, *args, **kwargs):
     removals.removed_module(__name__, "oslo_middleware.http_proxy_to_wsgi")
     super(SSLMiddleware, self).__init__(application, *args, **kwargs)
     self.oslo_conf.register_opts(OPTS, group='oslo_middleware')
Esempio n. 6
0
# All Rights Reserved.
#
#    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.


from debtcollector import removals


removals.removed_module('keystoneclient.openstack.common.apiclient',
                        version='0.7.1',
                        removal_version='2.0')
Esempio n. 7
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.
"""Deprecated.

This module is deprecated since version 1.13 and may be removed in version 2.0.
Use fixtures.Mock* classes instead.

"""

from debtcollector import removals
import fixtures


removals.removed_module("oslotest.mockpatch", replacement="fixtures",
                        version="1.13", removal_version="2.0",
                        message="Use fixtures.Mock* classes instead.")


PatchObject = fixtures.MockPatchObject
Patch = fixtures.MockPatch
Multiple = fixtures.MockPatchMultiple
Esempio n. 8
0
#
#    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.

from debtcollector import removals
import os_client_config


removals.removed_module("oslotest.functional",
                        version="2.9.0", removal_version="3.0",
                        message="oslotest.functional will be removed.")


def _get_openstack_auth(openstack_config, cloud_name, override_name):
    try:
        cloud_config = openstack_config.get_one_cloud(cloud_name)
    except os_client_config.exceptions.OpenStackConfigException:
        try:
            cloud_config = openstack_config.get_one_cloud(
                'devstack', auth=dict(
                    username=override_name, project_name=override_name))
        except os_client_config.exceptions.OpenStackConfigException:
            try:
                cloud_config = openstack_config.get_one_cloud('envvars')
            except os_client_config.exceptions.OpenStackConfigException:
Esempio n. 9
0
 def __init__(self, transformers, conf):
     removals.removed_module(__name__, "datasources.static")
     super(StaticPhysicalTransformer, self).__init__(transformers, conf)
     self._register_relations_direction()
Esempio n. 10
0
from debtcollector import removals
from oslo_config import cfg
from oslo_utils import timeutils

memcache_opts = [
    cfg.ListOpt('memcached_servers',
                help='Memcached servers or None for in process cache.'),
]

CONF = cfg.CONF
CONF.register_opts(memcache_opts)


# Indicate that this module is deprecated for removal and oslo.cache should
# be used instead.
removals.removed_module(__name__, 'oslo.cache')


def list_opts():
    """Entry point for oslo-config-generator."""
    return [(None, copy.deepcopy(memcache_opts))]


def get_client(memcached_servers=None):
    client_cls = Client

    if not memcached_servers:
        memcached_servers = CONF.memcached_servers
    if memcached_servers:
        import memcache
        client_cls = memcache.Client
Esempio n. 11
0
 def __init__(self, application, *args, **kwargs):
     removals.removed_module(__name__, "oslo_middleware.http_proxy_to_wsgi")
     super(SSLMiddleware, self).__init__(application, *args, **kwargs)
     self.oslo_conf.register_opts(OPTS, group='oslo_middleware')
Esempio n. 12
0
#    License for the specific language governing permissions and limitations
#    under the License.
"""YAML related utilities.

The main goal of this module is to standardize yaml management inside
openstack. This module reduce technical debt by avoiding re-implementations
of yaml manager in all the openstack projects.
Use this module inside openstack projects to handle yaml securely and properly.
"""

from debtcollector import removals
import yaml

removals.removed_module(
    'oslo_serialization.yamlutils',
    version='3.0.0',
    removal_version='4.0.0',
    message='The oslo_serialization.yamlutils will be removed')


def load(stream, is_safe=True):
    """Converts a YAML document to a Python object.

    :param stream: the YAML document to convert into a Python object. Accepts
                   a byte string, a Unicode string, an open binary file object,
                   or an open text file object.
    :param is_safe: Turn off safe loading. True by default and only load
                    standard YAML. This option can be turned off by
                    passing ``is_safe=False`` if you need to load not only
                    standard YAML tags or if you need to construct an
                    arbitrary python object.
Esempio n. 13
0
#    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 itertools
import os

from debtcollector import removals
import six

# TODO(harlowja): remove me in a future version, since the futurist
# is the replacement for this whole module...
removals.removed_module(__name__,
                        replacement="the 'prettytable' library",
                        version="1.16",
                        removal_version='2.0',
                        stacklevel=4)


class PleasantTable(object):
    """A tiny pretty printing table (like prettytable/tabulate but smaller).

    Creates simply formatted tables (with no special sauce)::

        >>> from taskflow.types import table
        >>> tbl = table.PleasantTable(['Name', 'City', 'State', 'Country'])
        >>> tbl.add_row(["Josh", "San Jose", "CA", "USA"])
        >>> print(tbl.pformat())
        +------+----------+-------+---------+
          Name |   City   | State | Country
Esempio n. 14
0
#
#         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.

from debtcollector import removals

from taskflow.persistence import models

# TODO(harlowja): remove me in a future version, since the models
# module is more appropriately named to what the objects in it are used for...
removals.removed_module(__name__,
                        replacement="'%s'" % models.__name__,
                        version="1.15",
                        removal_version='2.0',
                        stacklevel=4)

# Keep alias classes/functions... around until this module is removed.
LogBook = models.LogBook
FlowDetail = models.FlowDetail
AtomDetail = models.AtomDetail
TaskDetail = models.TaskDetail
RetryDetail = models.RetryDetail
atom_detail_type = models.atom_detail_type
atom_detail_class = models.atom_detail_class
ATOM_TYPES = models.ATOM_TYPES
Esempio n. 15
0
from debtcollector import removals
from oslo_config import cfg
from oslo_middleware import ssl

from heat.common.i18n import _

ssl_middleware_opts = [
    cfg.StrOpt('secure_proxy_ssl_header',
               default='X-Forwarded-Proto',
               deprecated_group='DEFAULT',
               help=_("The HTTP Header that will be used to determine what "
                      "the original request protocol scheme was, even if "
                      "it was removed by an SSL terminator proxy."))
]

removals.removed_module(__name__, "oslo_middleware.http_proxy_to_wsgi")


class SSLMiddleware(ssl.SSLMiddleware):
    def __init__(self, application, *args, **kwargs):
        # NOTE(cbrandily): calling super(ssl.SSLMiddleware, self).__init__
        # allows to define our opt (including a deprecation).
        super(ssl.SSLMiddleware, self).__init__(application, *args, **kwargs)
        self.oslo_conf.register_opts(ssl_middleware_opts,
                                     group='oslo_middleware')


def list_opts():
    yield None, ssl_middleware_opts
# All Rights Reserved.
#
#    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.

"""
Exception definitions.

Deprecated since v0.7.1. Use 'keystoneclient.exceptions' instead of
this module. This module may be removed in the 2.0.0 release.
"""

from debtcollector import removals

from keystoneclient.exceptions import *     # noqa


removals.removed_module('keystoneclient.apiclient.exceptions',
                        replacement='keystoneclient.exceptions',
                        version='0.7.1',
                        removal_version='2.0')
Esempio n. 17
0
#    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.
"""Deprecated.

.. warning::

  This module is deprecated as of the 1.7.0 release in favor of
  :py:mod:`keystoneclient.exceptions` and may be removed in the 2.0.0 release.

"""

from debtcollector import removals

from keystoneclient import exceptions

# NOTE(akurilin): Module 'keystoneclient.apiclient' contains only exceptions
# which are deprecated, so this module must also be deprecated which helps
# to report 'deprecated' status of exceptions for next kind of imports
#       from keystoneclient.apiclient import exceptions

removals.removed_module('keystoneclient.apiclient',
                        replacement='keystoneclient.exceptions',
                        version='0.7.1',
                        removal_version='2.0')

__all__ = [
    'exceptions',
]
Esempio n. 18
0
File: ssl.py Progetto: hongbin/heat
from oslo_config import cfg
from oslo_middleware import ssl

from heat.common.i18n import _

ssl_middleware_opts = [
    cfg.StrOpt('secure_proxy_ssl_header',
               default='X-Forwarded-Proto',
               deprecated_group='DEFAULT',
               help=_("The HTTP Header that will be used to determine what "
                      "the original request protocol scheme was, even if "
                      "it was removed by an SSL terminator proxy."))
]


removals.removed_module(__name__,
                        "oslo_middleware.http_proxy_to_wsgi")


class SSLMiddleware(ssl.SSLMiddleware):

    def __init__(self, application, *args, **kwargs):
        # NOTE(cbrandily): calling super(ssl.SSLMiddleware, self).__init__
        # allows to define our opt (including a deprecation).
        super(ssl.SSLMiddleware, self).__init__(application, *args, **kwargs)
        self.oslo_conf.register_opts(
            ssl_middleware_opts, group='oslo_middleware')


def list_opts():
    yield None, ssl_middleware_opts
Esempio n. 19
0
#    Copyright (C) 2015 Yahoo! Inc. All Rights Reserved.
#
#    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.

from debtcollector import removals
import futurist
from futurist import periodics


# TODO(harlowja): remove me in a future version, since the futurist
# is the replacement for this whole module...
removals.removed_module(__name__,
                        replacement="the '%s' library" % futurist.__name__,
                        version="1.15", removal_version='2.0',
                        stacklevel=4)


# Keep alias classes/functions... around until this module is removed.
periodic = periodics.periodic
PeriodicWorker = periodics.PeriodicWorker
Esempio n. 20
0
#
#         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.

from debtcollector import removals

from taskflow.persistence import models


# TODO(harlowja): remove me in a future version, since the models
# module is more appropriately named to what the objects in it are used for...
removals.removed_module(__name__,  replacement="'%s'" % models.__name__,
                        version="1.15", removal_version='2.0',
                        stacklevel=4)


# Keep alias classes/functions... around until this module is removed.
LogBook = models.LogBook
FlowDetail = models.FlowDetail
AtomDetail = models.AtomDetail
TaskDetail = models.TaskDetail
RetryDetail = models.RetryDetail
atom_detail_type = models.atom_detail_type
atom_detail_class = models.atom_detail_class
ATOM_TYPES = models.ATOM_TYPES
Esempio n. 21
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 itertools
import os

from debtcollector import removals
import six

# TODO(harlowja): remove me in a future version, since the futurist
# is the replacement for this whole module...
removals.removed_module(__name__,
                        replacement="the 'prettytable' library",
                        version="1.16", removal_version='2.0',
                        stacklevel=4)


class PleasantTable(object):
    """A tiny pretty printing table (like prettytable/tabulate but smaller).

    Creates simply formatted tables (with no special sauce)::

        >>> from taskflow.types import table
        >>> tbl = table.PleasantTable(['Name', 'City', 'State', 'Country'])
        >>> tbl.add_row(["Josh", "San Jose", "CA", "USA"])
        >>> print(tbl.pformat())
        +------+----------+-------+---------+
          Name |   City   | State | Country
        +------+----------+-------+---------+
Esempio n. 22
0
#
#         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 automaton
from automaton import exceptions as excp
from automaton import machines
from debtcollector import removals


# TODO(harlowja): remove me in a future version, since the futurist
# is the replacement for this whole module...
removals.removed_module(__name__,
                        replacement="the '%s' library" % automaton.__name__,
                        version="1.16", removal_version='2.0',
                        stacklevel=4)


# Keep alias classes/functions... around until this module is removed.
FSM = machines.FiniteMachine
FrozenMachine = excp.FrozenMachine
NotInitialized = excp.NotInitialized
InvalidState = excp.InvalidState
NotFound = excp.NotFound
Duplicate = excp.Duplicate
Esempio n. 23
0
 def __init__(self, conf):
     removals.removed_module(__name__, "datasources.static")
     super(StaticPhysicalDriver, self).__init__()
     self.cfg = conf
     self.cache = {}
# Copyright 2015 IBM Corp.
#
#    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.

from debtcollector import removals

from oslo_messaging.notify.messaging import *   # noqa


# NOTE(mriedem): removal depends on how we can cap requirements in
# stable/liberty such that neutron does not try to load this
removals.removed_module(__name__,
                        oslo_messaging.notify.messaging.__name__,
                        removal_version='?')
Esempio n. 25
0
# 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.

from debtcollector import removals
import os_client_config

removals.removed_module("oslotest.functional",
                        version="2.9.0",
                        removal_version="3.0",
                        message="oslotest.functional will be removed.")


def _get_openstack_auth(openstack_config, cloud_name, override_name):
    try:
        cloud_config = openstack_config.get_one_cloud(cloud_name)
    except os_client_config.exceptions.OpenStackConfigException:
        try:
            cloud_config = openstack_config.get_one_cloud(
                'devstack',
                auth=dict(username=override_name, project_name=override_name))
        except os_client_config.exceptions.OpenStackConfigException:
            try:
                cloud_config = openstack_config.get_one_cloud('envvars')
            except os_client_config.exceptions.OpenStackConfigException: