#
#    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.
"""Root Cinder module."""

import os

# Ensure compatibility issues are covered with pythondsn
os.environ['EVENTLET_NO_GREENDNS'] = 'yes'

# Make sure eventlet is loaded
import eventlet  # noqa

Set EVENTLET_NO_GREENDNS for IPv6 and dnspython compat
Set EVENTLET_NO_GREENDNS for IPv6 and dnspython compat

If dnspython is present it causes socket.getaddrinfo() to be
monkeypatched wiht code that does not work with IPv6. To get
around this, the EVENTLET_NO_GREENDNS environment variable
must be set before importing eventlet.

This is resolved in the eventlet upstream code [1], but has not
yet been released. Once our requirements have been raised past
the 0.19.0 release with a version that includes this change we
can remove this workaround.

[1] https://github.com/eventlet/eventlet/commit/52b09becacd23f384cf69ae37d70c893c43e3b13

Change-Id: Id9fe265d67f6e9ea5090bebcacae4a7a9150c5c2
Closes-bug: #1471049
