From b6f22571181b3ba5ae4c4af1464d5b44633fcbba Mon Sep 17 00:00:00 2001 From: Nguyen Hung Phuong Date: Thu, 18 Aug 2016 11:50:58 +0700 Subject: [PATCH] Clean imports in code In some part in the code we import objects. In the Openstack style guidelines they recommend to import only modules. http://docs.openstack.org/developer/hacking/#imports Change-Id: Ibd3464b52fd70bbfe77ce35cdffbbef95de24b12 --- functionaltests/api/v1/models/acl_models.py | 4 ++-- functionaltests/api/v1/models/ca_models.py | 4 ++-- functionaltests/api/v1/models/consumer_model.py | 4 ++-- functionaltests/api/v1/models/container_models.py | 6 +++--- functionaltests/api/v1/models/quota_models.py | 14 +++++++------- functionaltests/api/v1/models/secret_models.py | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/functionaltests/api/v1/models/acl_models.py b/functionaltests/api/v1/models/acl_models.py index 561724cbd..73dd97b23 100644 --- a/functionaltests/api/v1/models/acl_models.py +++ b/functionaltests/api/v1/models/acl_models.py @@ -13,10 +13,10 @@ 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. """ -from functionaltests.api.v1.models.base_models import BaseModel +from functionaltests.api.v1.models import base_models -class AclModel(BaseModel): +class AclModel(base_models.BaseModel): def __init__(self, acl_ref=None, read=None): super(AclModel, self).__init__() diff --git a/functionaltests/api/v1/models/ca_models.py b/functionaltests/api/v1/models/ca_models.py index 7b44516a5..cedef2564 100644 --- a/functionaltests/api/v1/models/ca_models.py +++ b/functionaltests/api/v1/models/ca_models.py @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. """ -from functionaltests.api.v1.models.base_models import BaseModel +from functionaltests.api.v1.models import base_models -class CAModel(BaseModel): +class CAModel(base_models.BaseModel): def __init__(self, expiration=None, ca_id=None, ca_ref=None, status=None, updated=None, created=None, plugin_name=None, diff --git a/functionaltests/api/v1/models/consumer_model.py b/functionaltests/api/v1/models/consumer_model.py index ae7c5f3e7..96dd1a881 100644 --- a/functionaltests/api/v1/models/consumer_model.py +++ b/functionaltests/api/v1/models/consumer_model.py @@ -13,10 +13,10 @@ 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. """ -from functionaltests.api.v1.models.base_models import BaseModel +from functionaltests.api.v1.models import base_models -class ConsumerModel(BaseModel): +class ConsumerModel(base_models.BaseModel): def __init__(self, name=None, URL=None, created=None, updated=None, status=None): diff --git a/functionaltests/api/v1/models/container_models.py b/functionaltests/api/v1/models/container_models.py index 2085d4603..ab1dac69d 100644 --- a/functionaltests/api/v1/models/container_models.py +++ b/functionaltests/api/v1/models/container_models.py @@ -13,17 +13,17 @@ 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. """ -from functionaltests.api.v1.models.base_models import BaseModel +from functionaltests.api.v1.models import base_models -class SecretRefModel(BaseModel): +class SecretRefModel(base_models.BaseModel): def __init__(self, name=None, secret_ref=None): self.name = name self.secret_ref = secret_ref -class ContainerModel(BaseModel): +class ContainerModel(base_models.BaseModel): def __init__(self, name=None, type=None, secret_refs=[], container_ref=None, consumers=None, status=None, diff --git a/functionaltests/api/v1/models/quota_models.py b/functionaltests/api/v1/models/quota_models.py index 64cd76cae..91cf31c46 100644 --- a/functionaltests/api/v1/models/quota_models.py +++ b/functionaltests/api/v1/models/quota_models.py @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. """ -from functionaltests.api.v1.models.base_models import BaseModel +from functionaltests.api.v1.models import base_models -class QuotasModel(BaseModel): +class QuotasModel(base_models.BaseModel): def __init__(self, secrets=None, orders=None, containers=None, consumers=None, cas=None): @@ -29,7 +29,7 @@ class QuotasModel(BaseModel): self.cas = cas -class QuotasResponseModel(BaseModel): +class QuotasResponseModel(base_models.BaseModel): def __init__(self, quotas=None): super(QuotasResponseModel, self).__init__() @@ -41,7 +41,7 @@ class QuotasResponseModel(BaseModel): return cls(quotas=quotas) -class ProjectQuotaRequestModel(BaseModel): +class ProjectQuotaRequestModel(base_models.BaseModel): def __init__(self, project_quotas=None): super(ProjectQuotaRequestModel, self).__init__() @@ -53,14 +53,14 @@ class ProjectQuotaRequestModel(BaseModel): return cls(project_quotas=project_quotas) -class ProjectQuotaOneModel(BaseModel): +class ProjectQuotaOneModel(base_models.BaseModel): def __init__(self, project_quotas=None): super(ProjectQuotaOneModel, self).__init__() self.project_quotas = QuotasModel(**project_quotas) -class ProjectQuotaListItemModel(BaseModel): +class ProjectQuotaListItemModel(base_models.BaseModel): def __init__(self, project_id=None, project_quotas=None): super(ProjectQuotaListItemModel, self).__init__() @@ -68,7 +68,7 @@ class ProjectQuotaListItemModel(BaseModel): self.project_quotas = QuotasModel(**project_quotas) -class ProjectQuotaListModel(BaseModel): +class ProjectQuotaListModel(base_models.BaseModel): def __init__(self, project_quotas=None): super(ProjectQuotaListModel, self).__init__() diff --git a/functionaltests/api/v1/models/secret_models.py b/functionaltests/api/v1/models/secret_models.py index 9337e8a5d..d1f837006 100644 --- a/functionaltests/api/v1/models/secret_models.py +++ b/functionaltests/api/v1/models/secret_models.py @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. """ -from functionaltests.api.v1.models.base_models import BaseModel +from functionaltests.api.v1.models import base_models -class SecretModel(BaseModel): +class SecretModel(base_models.BaseModel): def __init__(self, name=None, expiration=None, algorithm=None, secret_ref=None, bit_length=None, mode=None, secret_type=None,