Fixes ordered dict import (#33499)

Make it try to fallback to a pypi package if its not found in what
ships with python
This commit is contained in:
Tim Rupp 2017-12-02 21:26:23 -08:00 committed by GitHub
parent 07c9c28a06
commit df86d8f39e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -195,7 +195,10 @@ from ansible.module_utils.six import iteritems
try:
from collections import OrderedDict
except ImportError:
pass
try:
from ordereddict import OrderedDict
except ImportError:
pass
try:
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError

View file

@ -16,10 +16,10 @@ if sys.version_info < (2, 7):
raise SkipTest("F5 Ansible modules require Python >= 2.7")
from ansible.compat.tests import unittest
from ansible.compat.tests.mock import patch, Mock
from ansible.compat.tests.mock import Mock
from ansible.compat.tests.mock import patch
from ansible.module_utils.f5_utils import AnsibleF5Client
from ansible.module_utils.f5_utils import F5ModuleError
from units.modules.utils import set_module_args
try:
from library.bigip_ucs import Parameters
@ -28,6 +28,7 @@ try:
from library.bigip_ucs import V1Manager
from library.bigip_ucs import V2Manager
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
from test.unit.modules.utils import set_module_args
except ImportError:
try:
from ansible.modules.network.f5.bigip_ucs import Parameters
@ -36,6 +37,7 @@ except ImportError:
from ansible.modules.network.f5.bigip_ucs import V1Manager
from ansible.modules.network.f5.bigip_ucs import V2Manager
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
from units.modules.utils import set_module_args
except ImportError:
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")