Пример #1
0
def get_driver(provider):
    if provider in DEPRECATED_RACKSPACE_PROVIDERS:
        id_to_name_map = dict([(v, k) for k, v in Provider.__dict__.items()])
        old_name = id_to_name_map[provider]
        new_name = id_to_name_map[OLD_CONSTANT_TO_NEW_MAPPING[provider]]

        msg = 'Provider constant %s has been removed. New constant ' \
              'is now called %s.\n' \
              'For more information on this change and how to modify your ' \
              'code to work with it, please visit: TODO' % (old_name, new_name)
        raise Exception(msg)

    return _get_provider_driver(DRIVERS, provider)
Пример #2
0
def get_driver(provider):
    if provider in DEPRECATED_RACKSPACE_PROVIDERS:
        id_to_name_map = dict([(v, k) for k, v in Provider.__dict__.items()])
        old_name = id_to_name_map[provider]
        new_name = id_to_name_map[OLD_CONSTANT_TO_NEW_MAPPING[provider]]

        url = 'http://s.apache.org/lc0140un'
        msg = ('Provider constant %s has been removed. New constant '
               'is now called %s.\n'
               'For more information on this change and how to modify your '
               'code to work with it, please visit: %s' %
               (old_name, new_name, url))
        raise Exception(msg)

    return _get_provider_driver(DRIVERS, provider)
Пример #3
0
def get_driver(provider):
    if provider in DEPRECATED_DRIVERS:
        url = DEPRECATED_DRIVERS[provider]['url']
        reason = DEPRECATED_DRIVERS[provider]['reason']
        msg = ('Provider no longer supported: %s, please visit: %s' %
               (url, reason))
        raise Exception(msg)
    if provider in DEPRECATED_RACKSPACE_PROVIDERS:
        id_to_name_map = dict([(v, k) for k, v in Provider.__dict__.items()])
        old_name = id_to_name_map[provider]
        new_name = id_to_name_map[OLD_CONSTANT_TO_NEW_MAPPING[provider]]

        url = 'http://s.apache.org/lc0140un'
        msg = ('Provider constant %s has been removed. New constant '
               'is now called %s.\n'
               'For more information on this change and how to modify your '
               'code to work with it, please visit: %s' %
               (old_name, new_name, url))
        raise Exception(msg)

    return _get_provider_driver(DRIVERS, provider)
Пример #4
0
def get_driver(provider):
    return _get_provider_driver(DRIVERS, provider)
Пример #5
0
def get_driver(provider):
    return _get_provider_driver(DRIVERS, provider)