Skip to content

Commit

Permalink
Merge pull request #240 from nuwang/add_project_domain_id
Browse files Browse the repository at this point in the history
Added support for project domain id
  • Loading branch information
Alexandru Mahmoud committed Jun 10, 2020
2 parents 422a449 + 16dcb0c commit 290111a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cloudbridge/providers/azure/azure_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ def access_key_result(self):
storage_account)
raise WaitStateException(
"Waited too long for storage account: {0} to "
"become ready.".format(
"become ready. It's currently in state: {1}".format(
storage_account,
self.get_storage_account(storage_account).
provisioning_state))
self.get_storage_account(
storage_account).provisioning_state))

self._access_key_result = self.storage_client.storage_accounts. \
list_keys(self.resource_group, storage_account)
Expand Down
5 changes: 5 additions & 0 deletions cloudbridge/providers/openstack/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def __init__(self, config):
'os_region_name', get_env('OS_REGION_NAME'))
self._zone_name = self._get_config_value(
'os_zone_name', get_env('OS_ZONE_NAME'))
self.project_domain_id = self._get_config_value(
'os_project_domain_id',
get_env('OS_PROJECT_DOMAIN_ID'))
self.project_domain_name = self._get_config_value(
'os_project_domain_name',
get_env('OS_PROJECT_DOMAIN_NAME'))
Expand Down Expand Up @@ -113,6 +116,7 @@ def _keystone_session(self):
username=self.username,
password=self.password,
user_domain_name=self.user_domain_name,
project_domain_id=self.project_domain_id,
project_domain_name=self.project_domain_name,
project_name=self.project_name)
self._cached_keystone_session = session.Session(auth=auth)
Expand All @@ -133,6 +137,7 @@ def _connect_openstack(self):
username=self.username,
password=self.password,
user_domain_name=self.user_domain_name,
project_domain_id=self.project_domain_id,
project_domain_name=self.project_domain_name
)

Expand Down
6 changes: 6 additions & 0 deletions docs/topics/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ will override environment values.
'os_password': '<your password>',
'os_auth_url': '<auth url>,
'os_user_domain_name': '<user_domain_name>',
'os_project_domain_id': '<project_domain_id>',
'os_project_domain_name': '<project_domain_name>',
'os_project_name': '<project_name>')
provider = CloudProviderFactory().create_provider(ProviderList.OPENSTACK, config)
Expand Down Expand Up @@ -211,6 +212,8 @@ OpenStack
+-------------------------+--------------------------------------------------------------+
| os_storage_url | Storage endpoint URL, if applicable |
+-------------------------+--------------------------------------------------------------+
| os_project_domain_id | Project domain id for authentication. |
+-------------------------+--------------------------------------------------------------+
| os_project_domain_name | Project domain name for authentication. |
+-------------------------+--------------------------------------------------------------+
| os_user_domain_name | User domain name for authentication. |
Expand Down Expand Up @@ -328,6 +331,8 @@ OpenStack
+------------------------+-----------+
| OS_STORAGE_URL | |
+------------------------+-----------+
| OS_PROJECT_DOMAIN_ID | |
+------------------------+-----------+
| OS_PROJECT_DOMAIN_NAME | |
+------------------------+-----------+
| OS_USER_DOMAIN_NAME | |
Expand Down Expand Up @@ -376,6 +381,7 @@ OpenStack clouds).
os_password: password
os_auth_url: auth url
os_user_domain_name: user domain name
os_project_domain_id: project domain id
os_project_domain_name: project domain name
os_project_name: project name
Expand Down
4 changes: 2 additions & 2 deletions tests/test_network_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ def _cleanup(net, subnet, router, gateway):

self.assertTrue(
len(router.subnets) == 0,
"No subnet should be attached to router {1}".format(
sn, router)
"No subnet should be attached to router {0} but subnet {1}"
" is currently attached to it.".format(router, sn)
)
router.attach_subnet(sn)
self.assertTrue(
Expand Down

0 comments on commit 290111a

Please sign in to comment.