28
28
from heatclient import client as heatclient
29
29
from k8sclient .client import api_client
30
30
from k8sclient .client .apis import apiv_api
31
- from keystoneclient .v2_0 import client as ksclient
31
+ from keystoneclient .v3 import client as ksclient
32
32
33
33
from magnum .common .utils import rmtree_without_raise
34
34
import magnum .conf
@@ -53,8 +53,7 @@ def setUpClass(cls):
53
53
super (BaseMagnumClient , cls ).setUpClass ()
54
54
user = cliutils .env ('OS_USERNAME' )
55
55
passwd = cliutils .env ('OS_PASSWORD' )
56
- tenant = cliutils .env ('OS_TENANT_NAME' )
57
- tenant_id = cliutils .env ('OS_TENANT_ID' )
56
+ project_name = cliutils .env ('OS_PROJECT_NAME' )
58
57
auth_url = cliutils .env ('OS_AUTH_URL' )
59
58
insecure = cliutils .env ('INSECURE' )
60
59
region_name = cliutils .env ('OS_REGION_NAME' )
@@ -66,14 +65,16 @@ def setUpClass(cls):
66
65
keypair_id = cliutils .env ('KEYPAIR_ID' )
67
66
dns_nameserver = cliutils .env ('DNS_NAMESERVER' )
68
67
copy_logs = cliutils .env ('COPY_LOGS' )
68
+ user_domain_id = cliutils .env ('OS_USER_DOMAIN_ID' )
69
+ project_domain_id = cliutils .env ('OS_PROJECT_DOMAIN_ID' )
69
70
70
71
config = configparser .RawConfigParser ()
71
72
if config .read ('functional_creds.conf' ):
72
73
# the OR pattern means the environment is preferred for
73
74
# override
74
75
user = user or config .get ('admin' , 'user' )
75
76
passwd = passwd or config .get ('admin' , 'pass' )
76
- tenant = tenant or config .get ('admin' , 'tenant ' )
77
+ project_name = project_name or config .get ('admin' , 'project_name ' )
77
78
auth_url = auth_url or config .get ('auth' , 'auth_url' )
78
79
insecure = insecure or config .get ('auth' , 'insecure' )
79
80
magnum_url = magnum_url or config .get ('auth' , 'magnum_url' )
@@ -85,6 +86,11 @@ def setUpClass(cls):
85
86
keypair_id = keypair_id or config .get ('magnum' , 'keypair_id' )
86
87
dns_nameserver = dns_nameserver or config .get (
87
88
'magnum' , 'dns_nameserver' )
89
+ user_domain_id = user_domain_id or config .get (
90
+ 'admin' , 'user_domain_id' )
91
+ project_domain_id = project_domain_id or config .get (
92
+ 'admin' , 'project_domain_id' )
93
+
88
94
try :
89
95
copy_logs = copy_logs or config .get ('magnum' , 'copy_logs' )
90
96
except configparser .NoOptionError :
@@ -99,16 +105,19 @@ def setUpClass(cls):
99
105
cls .copy_logs = str (copy_logs ).lower () == 'true'
100
106
cls .cs = v1client .Client (username = user ,
101
107
api_key = passwd ,
102
- project_id = tenant_id ,
103
- project_name = tenant ,
108
+ project_name = project_name ,
104
109
auth_url = auth_url ,
105
110
insecure = insecure ,
111
+ user_domain_id = user_domain_id ,
112
+ project_domain_id = project_domain_id ,
106
113
service_type = 'container-infra' ,
107
114
region_name = region_name ,
108
115
magnum_url = magnum_url )
109
116
cls .keystone = ksclient .Client (username = user ,
110
117
password = passwd ,
111
- tenant_name = tenant ,
118
+ project_name = project_name ,
119
+ project_domain_id = project_domain_id ,
120
+ user_domain_id = user_domain_id ,
112
121
auth_url = auth_url ,
113
122
insecure = insecure )
114
123
token = cls .keystone .auth_token
0 commit comments