diff --git a/cloudcafe/auth/__init__.py b/cloudcafe/auth/__init__.py index e69de29b..59ab77fa 100644 --- a/cloudcafe/auth/__init__.py +++ b/cloudcafe/auth/__init__.py @@ -0,0 +1,15 @@ +""" +Copyright 2013 Rackspace + +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. +""" diff --git a/cloudcafe/auth/config.py b/cloudcafe/auth/config.py index 38c43380..9e2b2bf8 100644 --- a/cloudcafe/auth/config.py +++ b/cloudcafe/auth/config.py @@ -1,3 +1,19 @@ +""" +Copyright 2013 Rackspace + +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. +""" + from cloudcafe.common.models.configuration import ConfigSectionInterface diff --git a/cloudcafe/auth/provider.py b/cloudcafe/auth/provider.py index f6eca7f7..3f385d56 100644 --- a/cloudcafe/auth/provider.py +++ b/cloudcafe/auth/provider.py @@ -1,3 +1,19 @@ +""" +Copyright 2013 Rackspace + +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. +""" + from cloudcafe.extensions.rax_auth.v2_0.tokens_api.client import \ TokenAPI_Client as RaxTokenAPI_Client from cloudcafe.extensions.rax_auth.v2_0.tokens_api.behaviors import \ diff --git a/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/base.py b/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/base.py index a8c5a971..5248666a 100644 --- a/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/base.py +++ b/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/base.py @@ -25,15 +25,24 @@ class BaseIdentityModel(AutoMarshallingModel): @classmethod def _remove_identity_xml_namespaces(cls, element): - cls._remove_namespace(element, V2_0Constants.XML_NS) - cls._remove_namespace(element, V2_0Constants.XML_NS_OS_KSADM) - cls._remove_namespace(element, V2_0Constants.XML_NS_RAX_KSKEY) - cls._remove_namespace(element, V2_0Constants.XML_NS_OS_KSEC2) - cls._remove_namespace(element, V2_0Constants.XML_NS_RAX_KSQA) - cls._remove_namespace(element, V2_0Constants.XML_NS_RAX_AUTH) - cls._remove_namespace(element, V2_0Constants.XML_NS_RAX_KSGRP) - cls._remove_namespace(element, V2_0Constants.XML_NS_OPENSTACK_COMMON) - cls._remove_namespace(element, V2_0Constants.XML_NS_ATOM) + cls._remove_xml_etree_namespace( + element, V2_0Constants.XML_NS) + cls._remove_xml_etree_namespace( + element, V2_0Constants.XML_NS_OS_KSADM) + cls._remove_xml_etree_namespace( + element, V2_0Constants.XML_NS_RAX_KSKEY) + cls._remove_xml_etree_namespace( + element, V2_0Constants.XML_NS_OS_KSEC2) + cls._remove_xml_etree_namespace( + element, V2_0Constants.XML_NS_RAX_KSQA) + cls._remove_xml_etree_namespace( + element, V2_0Constants.XML_NS_RAX_AUTH) + cls._remove_xml_etree_namespace( + element, V2_0Constants.XML_NS_RAX_KSGRP) + cls._remove_xml_etree_namespace( + element, V2_0Constants.XML_NS_OPENSTACK_COMMON) + cls._remove_xml_etree_namespace( + element, V2_0Constants.XML_NS_ATOM) class BaseIdentityListModel(AutoMarshallingListModel): diff --git a/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/requests/auth.py b/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/requests/auth.py index 862c6e76..8c54c622 100644 --- a/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/requests/auth.py +++ b/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/requests/auth.py @@ -31,6 +31,7 @@ class Auth(BaseIdentityModel): def __init__(self, apiKeyCredentials=None, tenantId=None, token=None): + super(Auth, self).__init__() self.apiKeyCredentials = apiKeyCredentials self.token = token self.tenantId = tenantId diff --git a/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/responses/access.py b/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/responses/access.py index 2818d1b4..a4e10bf7 100644 --- a/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/responses/access.py +++ b/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/responses/access.py @@ -24,6 +24,7 @@ class Access(BaseIdentityModel): TAG = 'access' def __init__(self): + super(Access, self).__init__() self.metadata = {} self.service_catalog = ServiceCatalog() self.user = User() @@ -68,6 +69,7 @@ class ServiceCatalog(BaseIdentityListModel): class Service(BaseIdentityModel): def __init__(self): + super(Service, self).__init__() self.endpoints = EndpointList() self.endpoint_links = [] self.name = None @@ -112,6 +114,7 @@ class Endpoint(BaseIdentityModel): def __init__(self, admin_url, internal_url, public_url, region, id, tenant_id=None): + super(Endpoint, self).__init__() self.admin_url = admin_url self.internal_url = internal_url self.public_url = public_url @@ -134,6 +137,7 @@ class Token(BaseIdentityModel): TAG = 'token' def __init__(self): + super(Token, self).__init__() self.expires = None self.issued_at = None self.id_ = None @@ -154,6 +158,7 @@ class Tenant(BaseIdentityModel): TAG = 'tenant' def __init__(self): + super(Tenant, self).__init__() self.description = None self.enabled = None self.id_ = None @@ -174,6 +179,7 @@ class User(BaseIdentityModel): TAG = 'user' def __init__(self): + super(User, self).__init__() self.id_ = None self.name = None self.roles = RoleList() @@ -208,4 +214,5 @@ class RoleList(BaseIdentityListModel): class Role(BaseIdentityListModel): def __init__(self, name=None): + super(Role, self).__init__() self.name = name diff --git a/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/responses/endpoint.py b/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/responses/endpoint.py index 4e9e494f..835bedda 100644 --- a/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/responses/endpoint.py +++ b/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/responses/endpoint.py @@ -60,7 +60,6 @@ class Endpoint(BaseIdentityModel): def __init__(self, tenantId=None, region=None, id=None, publicURL=None, name=None, adminURL=None, type=None, internalURL=None, versionId=None, versionInfo=None, versionList=None): - # version=None super(Endpoint, self).__init__() self.tenantId = tenantId self.region = region @@ -73,9 +72,8 @@ class Endpoint(BaseIdentityModel): self.versionId = versionId self.versionInfo = versionInfo self.versionList = versionList - #currently json has version attributes as part of the Endpoint - #xml has it as a seprate element. - # self.version = version + # currently json has version attributes as part of the Endpoint + # xml has it as a separate element. @classmethod def _json_to_obj(cls, serialized_str): @@ -122,6 +120,7 @@ class Version(BaseIdentityModel): ROOT_TAG = 'version' def __init__(self, id=None, info=None, list=None): + super(Version, self).__init__() self.id = id self.info = info self.list = list diff --git a/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/responses/user.py b/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/responses/user.py index 79997d72..ae33485e 100644 --- a/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/responses/user.py +++ b/cloudcafe/extensions/rax_auth/v2_0/tokens_api/models/responses/user.py @@ -142,8 +142,8 @@ class User(BaseIdentityModel): kwargs['enabled'] = json.loads(xml_ele.get('enabled').lower()) roles = xml_ele.find(Roles.ROOT_TAG) if roles is not None: - #if roles is not a list it is a single element with a list of - #role elements + # if roles is not a list it is a single element with a list of + # role elements roles = roles.findall(Role.ROOT_TAG) if roles is not None: kwargs['roles'] = Roles._xml_list_to_obj(roles)