From 9e8bd56666ed1cbf75c7427f17347e9050da2589 Mon Sep 17 00:00:00 2001 From: David Weinholz Date: Thu, 23 May 2019 17:18:20 +0200 Subject: [PATCH] fix(Project):added project domain id --- VirtualMachineService/VirtualMachineHandler.py | 3 ++- VirtualMachineService/VirtualMachineServer.py | 2 ++ docker-compose.yml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index 139f24a5..20964455 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -60,7 +60,7 @@ def create_connection(self): auth_url=self.AUTH_URL, project_name=self.PROJECT_NAME, user_domain_name=self.USER_DOMAIN_NAME, - project_domain_name="default", + project_domain_id=self.PROJECT_DOMAIN_ID ) conn.authorize() except Exception as e: @@ -102,6 +102,7 @@ def __init__(self, config): self.PROJECT_ID = os.environ["OS_PROJECT_ID"] self.USER_DOMAIN_NAME = os.environ["OS_USER_DOMAIN_NAME"] self.AUTH_URL = os.environ["OS_AUTH_URL"] + self.PROJECT_DOMAIN_ID=os.environ["OS_PROJECT_DOMAIN_ID"] self.SSH_PORT = 22 with open(config, "r") as ymlfile: diff --git a/VirtualMachineService/VirtualMachineServer.py b/VirtualMachineService/VirtualMachineServer.py index ec635fef..5cce1499 100644 --- a/VirtualMachineService/VirtualMachineServer.py +++ b/VirtualMachineService/VirtualMachineServer.py @@ -24,6 +24,7 @@ PROJECT_ID = 'OS_PROJECT_ID' USER_DOMAIN_ID = 'OS_USER_DOMAIN_NAME' AUTH_URL = 'OS_AUTH_URL' +PROJECT_DOMAIN_ID="OS_PROJECT_DOMAIN_ID" environment_variables = [ USERNAME, @@ -32,6 +33,7 @@ PROJECT_ID, USER_DOMAIN_ID, AUTH_URL, + PROJECT_DOMAIN_ID ] diff --git a/docker-compose.yml b/docker-compose.yml index 60ebc3d9..11334cf3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,6 +14,7 @@ services: - OS_USERNAME - OS_PASSWORD - OS_USER_DOMAIN_NAME + - OS_PROJECT_DOMAIN_ID volumes: - ./VirtualMachineService/config/config.yml:/code/VirtualMachineService/config.yml