diff --git a/tests/integration/modules/test_libcloud_dns.py b/tests/integration/modules/test_libcloud_dns.py index 7719ee7f7f..7ce1193786 100644 --- a/tests/integration/modules/test_libcloud_dns.py +++ b/tests/integration/modules/test_libcloud_dns.py @@ -1,9 +1,25 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import +# import salt libs +from salt.utils.versions import LooseVersion as _LooseVersion + +# Import test Helpers from tests.support.case import ModuleCase +from tests.support.unit import skipIf + +REQUIRED_LIBCLOUD_VERSION = '0.21.0' +try: + import libcloud + #pylint: enable=unused-import + if _LooseVersion(getattr(libcloud, '__version__', '0.0.0')) < _LooseVersion(REQUIRED_LIBCLOUD_VERSION): + raise ImportError() + HAS_LIBCLOUD = True +except ImportError: + HAS_LIBCLOUD = False +@skipIf(not HAS_LIBCLOUD, 'Requires libcloud >= {0}'.format(REQUIRED_LIBCLOUD_VERSION)) class LibcloudDNSTest(ModuleCase): ''' Validate the libcloud_dns module