Clean imports in code
This patch set modifies lines which are importing objects
instead of modules. As per openstack import guide lines, user should
import modules in a file not objects.
http://docs.openstack.org/developer/hacking/#imports
Change-Id: I846a3edcea448ea09764f4f3d435f5c7a95326ff
diff --git a/designate_tempest_plugin/clients.py b/designate_tempest_plugin/clients.py
index d85d343..5a8136c 100644
--- a/designate_tempest_plugin/clients.py
+++ b/designate_tempest_plugin/clients.py
@@ -13,9 +13,7 @@
# under the License.
from tempest import clients
from tempest import config
-from tempest.lib.auth import KeystoneAuthProvider
-from tempest.lib.auth import KeystoneV2AuthProvider
-from tempest.lib.auth import KeystoneV3AuthProvider
+from tempest.lib import auth
from designate_tempest_plugin.services.dns.v1.json.domains_client import \
DomainsClient
@@ -158,7 +156,7 @@
return KeystoneV2UnauthedProvider
-class BaseUnauthedProvider(KeystoneAuthProvider):
+class BaseUnauthedProvider(auth.KeystoneAuthProvider):
def _decorate_request(self, filters, method, url, headers=None, body=None,
auth_data=None):
@@ -173,13 +171,15 @@
return url, headers, body
-class KeystoneV2UnauthedProvider(KeystoneV2AuthProvider, BaseUnauthedProvider):
+class KeystoneV2UnauthedProvider(auth.KeystoneV2AuthProvider,
+ BaseUnauthedProvider):
def _decorate_request(self, *args, **kwargs):
return BaseUnauthedProvider._decorate_request(self, *args, **kwargs)
-class KeystoneV3UnauthedProvider(KeystoneV3AuthProvider, BaseUnauthedProvider):
+class KeystoneV3UnauthedProvider(auth.KeystoneV3AuthProvider,
+ BaseUnauthedProvider):
def _decorate_request(self, *args, **kwargs):
return BaseUnauthedProvider._decorate_request(self, *args, **kwargs)
diff --git a/designate_tempest_plugin/services/dns/json/base.py b/designate_tempest_plugin/services/dns/json/base.py
index 19dbe45..6c5f1d2 100644
--- a/designate_tempest_plugin/services/dns/json/base.py
+++ b/designate_tempest_plugin/services/dns/json/base.py
@@ -20,7 +20,7 @@
from six.moves.urllib import parse as urllib
import six
-from designate_tempest_plugin.common.models import ZoneFile
+from designate_tempest_plugin.common import models
LOG = logging.getLogger(__name__)
@@ -66,7 +66,7 @@
if 'application/json' in resp['content-type']:
return json.loads(object_str)
elif 'text/dns' in resp['content-type']:
- return ZoneFile.from_text(object_str)
+ return models.ZoneFile.from_text(object_str)
else:
raise lib_exc.InvalidContentType()
diff --git a/designate_tempest_plugin/tests/api/v2/test_unauthed.py b/designate_tempest_plugin/tests/api/v2/test_unauthed.py
index e788a3b..b48cfd7 100644
--- a/designate_tempest_plugin/tests/api/v2/test_unauthed.py
+++ b/designate_tempest_plugin/tests/api/v2/test_unauthed.py
@@ -17,7 +17,7 @@
import ddt
from designate_tempest_plugin.tests import base
-from designate_tempest_plugin.clients import ManagerV2Unauthed
+from designate_tempest_plugin import clients
LOG = logging.getLogger(__name__)
@@ -25,7 +25,7 @@
@ddt.ddt
class TestDnsUnauthed(base.BaseDnsV2Test):
- client_manager = ManagerV2Unauthed
+ client_manager = clients.ManagerV2Unauthed
credentials = ["primary"]
@classmethod