blob: d7a740a2f2014103f80f72d409255631325f3ef4 [file] [log] [blame]
Jay Pipes3f981df2012-03-27 18:59:44 -04001# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 OpenStack, LLC
4# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
Mitsuhiko Yamazaki46818aa2013-04-18 17:49:17 +090018from tempest.common import log as logging
Jay Pipesf38eaac2012-06-21 13:37:35 -040019from tempest import config
Daryl Walleck587385b2012-03-03 13:00:26 -060020from tempest import exceptions
Attila Fazekas1aed6202013-02-11 14:47:45 +010021from tempest.services import botoclients
Mitsuhiko Yamazaki74f07072013-04-02 11:52:31 +090022from tempest.services.compute.json.aggregates_client import \
23 AggregatesClientJSON
Leo Toyodaa5278912013-04-16 15:40:12 +090024from tempest.services.compute.json.availability_zone_client import \
25 AvailabilityZoneClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050026from tempest.services.compute.json.extensions_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053027 ExtensionsClientJSON
Sean Dague2416cf32013-04-10 08:29:07 -040028from tempest.services.compute.json.fixed_ips_client import FixedIPsClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050029from tempest.services.compute.json.flavors_client import FlavorsClientJSON
30from tempest.services.compute.json.floating_ips_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053031 FloatingIPsClientJSON
Attila Fazekas8e99b992013-02-24 09:53:23 +010032from tempest.services.compute.json.hosts_client import HostsClientJSON
Tony Yang3d5f1632013-06-06 14:17:57 +080033from tempest.services.compute.json.hypervisor_client import \
34 HypervisorClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050035from tempest.services.compute.json.images_client import ImagesClientJSON
Sean Dague2416cf32013-04-10 08:29:07 -040036from tempest.services.compute.json.interfaces_client import \
37 InterfacesClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +010038from tempest.services.compute.json.keypairs_client import KeyPairsClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050039from tempest.services.compute.json.limits_client import LimitsClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +010040from tempest.services.compute.json.quotas_client import QuotasClientJSON
Matthew Treinisha83a16e2012-12-07 13:44:02 -050041from tempest.services.compute.json.security_groups_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053042 SecurityGroupsClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +010043from tempest.services.compute.json.servers_client import ServersClientJSON
Leo Toyoda3ae31e12013-04-19 11:19:57 +090044from tempest.services.compute.json.services_client import ServicesClientJSON
Leo Toyodad80b6a02013-05-08 12:15:13 +090045from tempest.services.compute.json.tenant_usages_client import \
46 TenantUsagesClientJSON
Matthew Treinisha83a16e2012-12-07 13:44:02 -050047from tempest.services.compute.json.volumes_extensions_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053048 VolumesExtensionsClientJSON
Mitsuhiko Yamazakiae8fc532013-04-22 11:17:35 +090049from tempest.services.compute.xml.aggregates_client import AggregatesClientXML
Leo Toyodaa5278912013-04-16 15:40:12 +090050from tempest.services.compute.xml.availability_zone_client import \
51 AvailabilityZoneClientXML
dwallecke62b9f02012-10-10 23:34:42 -050052from tempest.services.compute.xml.extensions_client import ExtensionsClientXML
Sean Dague2416cf32013-04-10 08:29:07 -040053from tempest.services.compute.xml.fixed_ips_client import FixedIPsClientXML
dwallecke62b9f02012-10-10 23:34:42 -050054from tempest.services.compute.xml.flavors_client import FlavorsClientXML
55from tempest.services.compute.xml.floating_ips_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053056 FloatingIPsClientXML
Tony Yang3d5f1632013-06-06 14:17:57 +080057from tempest.services.compute.xml.hypervisor_client import HypervisorClientXML
dwallecke62b9f02012-10-10 23:34:42 -050058from tempest.services.compute.xml.images_client import ImagesClientXML
Sean Dague2416cf32013-04-10 08:29:07 -040059from tempest.services.compute.xml.interfaces_client import \
60 InterfacesClientXML
dwallecke62b9f02012-10-10 23:34:42 -050061from tempest.services.compute.xml.keypairs_client import KeyPairsClientXML
62from tempest.services.compute.xml.limits_client import LimitsClientXML
rajalakshmi-ganesan1982c3c2013-01-10 14:56:45 +053063from tempest.services.compute.xml.quotas_client import QuotasClientXML
dwallecke62b9f02012-10-10 23:34:42 -050064from tempest.services.compute.xml.security_groups_client \
harika-vakadi1a9ad612012-12-14 19:12:08 +053065 import SecurityGroupsClientXML
dwallecke62b9f02012-10-10 23:34:42 -050066from tempest.services.compute.xml.servers_client import ServersClientXML
Leo Toyoda3ae31e12013-04-19 11:19:57 +090067from tempest.services.compute.xml.services_client import ServicesClientXML
Leo Toyodad80b6a02013-05-08 12:15:13 +090068from tempest.services.compute.xml.tenant_usages_client import \
69 TenantUsagesClientXML
Matthew Treinisha83a16e2012-12-07 13:44:02 -050070from tempest.services.compute.xml.volumes_extensions_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053071 VolumesExtensionsClientXML
Attila Fazekas407b6db2013-01-19 12:48:36 +010072from tempest.services.identity.json.identity_client import IdentityClientJSON
73from tempest.services.identity.json.identity_client import TokenClientJSON
Sean Dague2416cf32013-04-10 08:29:07 -040074from tempest.services.identity.v3.json.endpoints_client import \
75 EndPointClientJSON
rajalakshmi-ganesan7312bb52013-01-29 20:03:42 +053076from tempest.services.identity.v3.json.identity_client import \
77 IdentityV3ClientJSON
harika-vakadi40e10112013-02-08 14:38:09 +053078from tempest.services.identity.v3.json.policy_client import PolicyClientJSON
harika-vakadia92dd742013-02-19 20:41:22 +053079from tempest.services.identity.v3.json.service_client import \
80 ServiceClientJSON
rajalakshmi-ganesanab426722013-02-08 15:49:15 +053081from tempest.services.identity.v3.xml.endpoints_client import EndPointClientXML
rajalakshmi-ganesan7312bb52013-01-29 20:03:42 +053082from tempest.services.identity.v3.xml.identity_client import \
83 IdentityV3ClientXML
harika-vakadi40e10112013-02-08 14:38:09 +053084from tempest.services.identity.v3.xml.policy_client import PolicyClientXML
harika-vakadia92dd742013-02-19 20:41:22 +053085from tempest.services.identity.v3.xml.service_client import \
86 ServiceClientXML
Attila Fazekas407b6db2013-01-19 12:48:36 +010087from tempest.services.identity.xml.identity_client import IdentityClientXML
88from tempest.services.identity.xml.identity_client import TokenClientXML
Matthew Treinish6d59c992013-03-01 16:20:04 -050089from tempest.services.image.v1.json.image_client import ImageClientJSON
Matthew Treinisha62347f2013-03-01 16:37:30 -050090from tempest.services.image.v2.json.image_client import ImageClientV2JSON
Matthew Treinisha83a16e2012-12-07 13:44:02 -050091from tempest.services.network.json.network_client import NetworkClient
dwalleck5d734432012-10-04 01:11:47 -050092from tempest.services.object_storage.account_client import AccountClient
harika-vakadi2daed0a2013-01-01 20:51:39 +053093from tempest.services.object_storage.account_client import \
94 AccountClientCustomizedHeader
Attila Fazekas6968dd52013-02-15 17:05:53 +010095from tempest.services.object_storage.container_client import ContainerClient
96from tempest.services.object_storage.object_client import ObjectClient
97from tempest.services.object_storage.object_client import \
98 ObjectClientCustomizedHeader
Steve Bakerc60e4e32013-05-06 15:22:41 +120099from tempest.services.orchestration.json.orchestration_client import \
100 OrchestrationClient
Attila Fazekas6968dd52013-02-15 17:05:53 +0100101from tempest.services.volume.json.admin.volume_types_client import \
102 VolumeTypesClientJSON
103from tempest.services.volume.json.snapshots_client import SnapshotsClientJSON
104from tempest.services.volume.json.volumes_client import VolumesClientJSON
105from tempest.services.volume.xml.admin.volume_types_client import \
106 VolumeTypesClientXML
107from tempest.services.volume.xml.snapshots_client import SnapshotsClientXML
108from tempest.services.volume.xml.volumes_client import VolumesClientXML
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800109
Jay Pipes3f981df2012-03-27 18:59:44 -0400110LOG = logging.getLogger(__name__)
111
Mauro S. M. Rodrigues6e373242012-08-27 18:59:19 -0400112IMAGES_CLIENTS = {
113 "json": ImagesClientJSON,
114 "xml": ImagesClientXML,
115}
116
Mauro S. M. Rodriguesa636f532012-08-21 11:07:53 -0400117KEYPAIRS_CLIENTS = {
118 "json": KeyPairsClientJSON,
119 "xml": KeyPairsClientXML,
120}
121
rajalakshmi-ganesan1982c3c2013-01-10 14:56:45 +0530122QUOTAS_CLIENTS = {
123 "json": QuotasClientJSON,
124 "xml": QuotasClientXML,
125}
126
Dan Smithcf8fab62012-08-14 08:03:48 -0700127SERVERS_CLIENTS = {
128 "json": ServersClientJSON,
129 "xml": ServersClientXML,
130}
131
Matthew Treinish33634462012-08-16 16:51:23 -0400132LIMITS_CLIENTS = {
133 "json": LimitsClientJSON,
134 "xml": LimitsClientXML,
135}
136
Tiago Melloeda03b52012-08-22 23:47:29 -0300137FLAVORS_CLIENTS = {
138 "json": FlavorsClientJSON,
139 "xml": FlavorsClientXML
140}
141
Tiago Mello89126c32012-08-27 11:14:03 -0300142EXTENSIONS_CLIENTS = {
143 "json": ExtensionsClientJSON,
144 "xml": ExtensionsClientXML
145}
146
Matthew Treinish4e086902012-08-17 17:52:22 -0400147VOLUMES_EXTENSIONS_CLIENTS = {
148 "json": VolumesExtensionsClientJSON,
149 "xml": VolumesExtensionsClientXML,
150}
151
Vincent Hou22f03c72012-08-24 17:55:13 +0800152FLOAT_CLIENTS = {
153 "json": FloatingIPsClientJSON,
154 "xml": FloatingIPsClientXML,
155}
156
Attila Fazekas36b1fcf2013-01-31 16:41:04 +0100157SNAPSHOTS_CLIENTS = {
158 "json": SnapshotsClientJSON,
159 "xml": SnapshotsClientXML,
160}
161
Matthew Treinish9854d5b2012-09-20 10:22:13 -0400162VOLUMES_CLIENTS = {
163 "json": VolumesClientJSON,
164 "xml": VolumesClientXML,
165}
166
Attila Fazekas3dcdae12013-02-14 12:50:04 +0100167VOLUME_TYPES_CLIENTS = {
168 "json": VolumeTypesClientJSON,
169 "xml": VolumeTypesClientXML,
170}
171
Attila Fazekas407b6db2013-01-19 12:48:36 +0100172IDENTITY_CLIENT = {
173 "json": IdentityClientJSON,
174 "xml": IdentityClientXML,
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800175}
176
rajalakshmi-ganesan7312bb52013-01-29 20:03:42 +0530177IDENTITY_V3_CLIENT = {
178 "json": IdentityV3ClientJSON,
179 "xml": IdentityV3ClientXML,
180}
181
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800182TOKEN_CLIENT = {
183 "json": TokenClientJSON,
184 "xml": TokenClientXML,
185}
186
Vincent Houead03dc2012-08-24 21:35:11 +0800187SECURITY_GROUPS_CLIENT = {
188 "json": SecurityGroupsClientJSON,
189 "xml": SecurityGroupsClientXML,
190}
191
Dan Smith8ad1c472013-02-26 13:03:16 -0500192INTERFACES_CLIENT = {
193 "json": InterfacesClientJSON,
194 "xml": InterfacesClientXML,
195}
196
rajalakshmi-ganesanab426722013-02-08 15:49:15 +0530197ENDPOINT_CLIENT = {
198 "json": EndPointClientJSON,
199 "xml": EndPointClientXML,
200}
201
Mauro S. M. Rodriguesf5166402013-04-01 10:25:26 -0400202FIXED_IPS_CLIENT = {
203 "json": FixedIPsClientJSON,
204 "xml": FixedIPsClientXML
205}
206
Leo Toyodaa5278912013-04-16 15:40:12 +0900207AVAILABILITY_ZONE_CLIENT = {
208 "json": AvailabilityZoneClientJSON,
209 "xml": AvailabilityZoneClientXML,
210}
211
harika-vakadia92dd742013-02-19 20:41:22 +0530212SERVICE_CLIENT = {
213 "json": ServiceClientJSON,
214 "xml": ServiceClientXML,
215}
216
Mitsuhiko Yamazakiae8fc532013-04-22 11:17:35 +0900217AGGREGATES_CLIENT = {
218 "json": AggregatesClientJSON,
219 "xml": AggregatesClientXML,
220}
221
Leo Toyoda3ae31e12013-04-19 11:19:57 +0900222SERVICES_CLIENT = {
223 "json": ServicesClientJSON,
224 "xml": ServicesClientXML,
225}
226
Leo Toyodad80b6a02013-05-08 12:15:13 +0900227TENANT_USAGES_CLIENT = {
228 "json": TenantUsagesClientJSON,
229 "xml": TenantUsagesClientXML,
230}
231
harika-vakadi40e10112013-02-08 14:38:09 +0530232POLICY_CLIENT = {
233 "json": PolicyClientJSON,
234 "xml": PolicyClientXML,
235}
236
Tony Yang3d5f1632013-06-06 14:17:57 +0800237HYPERVISOR_CLIENT = {
238 "json": HypervisorClientJSON,
239 "xml": HypervisorClientXML,
240}
241
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800242
Daryl Walleck1465d612011-11-02 02:22:15 -0500243class Manager(object):
244
Jay Pipes3f981df2012-03-27 18:59:44 -0400245 """
246 Top level manager for OpenStack Compute clients
247 """
248
James E. Blaire6d8ee12013-01-18 21:33:45 +0000249 def __init__(self, username=None, password=None, tenant_name=None,
250 interface='json'):
Jay Pipesff10d552012-04-06 14:18:50 -0400251 """
252 We allow overriding of the credentials used within the various
253 client classes managed by the Manager object. Left as None, the
254 standard username/password/tenant_name is used.
255
256 :param username: Override of the username
257 :param password: Override of the password
258 :param tenant_name: Override of the tenant name
259 """
Jay Pipesf38eaac2012-06-21 13:37:35 -0400260 self.config = config.TempestConfig()
Rohit Karajgie1b050d2011-12-02 16:13:18 -0800261
Jay Pipesf38eaac2012-06-21 13:37:35 -0400262 # If no creds are provided, we fall back on the defaults
263 # in the config file for the Compute API.
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100264 self.username = username or self.config.identity.username
265 self.password = password or self.config.identity.password
266 self.tenant_name = tenant_name or self.config.identity.tenant_name
Daryl Walleckced8eb82012-03-19 13:52:37 -0500267
Rohit Karajgidd47d7e2012-07-31 04:11:01 -0700268 if None in (self.username, self.password, self.tenant_name):
Jay Pipes3f981df2012-03-27 18:59:44 -0400269 msg = ("Missing required credentials. "
270 "username: %(username)s, password: %(password)s, "
271 "tenant_name: %(tenant_name)s") % locals()
272 raise exceptions.InvalidConfiguration(msg)
273
Jay Pipes7c88eb22013-01-16 21:32:43 -0500274 self.auth_url = self.config.identity.uri
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500275 self.auth_url_v3 = self.config.identity.uri_v3
Daryl Walleck587385b2012-03-03 13:00:26 -0600276
Li Ma216550f2013-06-12 11:26:08 -0700277 client_args = (self.config, self.username, self.password,
278 self.auth_url, self.tenant_name)
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500279
Li Ma216550f2013-06-12 11:26:08 -0700280 if self.auth_url_v3:
281 auth_version = 'v3'
282 client_args_v3_auth = (self.config, self.username,
283 self.password, self.auth_url_v3,
284 self.tenant_name, auth_version)
Daryl Walleck1465d612011-11-02 02:22:15 -0500285 else:
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500286 client_args_v3_auth = None
287
Dan Smithcf8fab62012-08-14 08:03:48 -0700288 try:
289 self.servers_client = SERVERS_CLIENTS[interface](*client_args)
Matthew Treinish33634462012-08-16 16:51:23 -0400290 self.limits_client = LIMITS_CLIENTS[interface](*client_args)
Mauro S. M. Rodrigues6e373242012-08-27 18:59:19 -0400291 self.images_client = IMAGES_CLIENTS[interface](*client_args)
Mauro S. M. Rodriguesa636f532012-08-21 11:07:53 -0400292 self.keypairs_client = KEYPAIRS_CLIENTS[interface](*client_args)
rajalakshmi-ganesan1982c3c2013-01-10 14:56:45 +0530293 self.quotas_client = QUOTAS_CLIENTS[interface](*client_args)
Tiago Melloeda03b52012-08-22 23:47:29 -0300294 self.flavors_client = FLAVORS_CLIENTS[interface](*client_args)
Zhongyue Luoe0884a32012-09-25 17:24:17 +0800295 ext_cli = EXTENSIONS_CLIENTS[interface](*client_args)
296 self.extensions_client = ext_cli
297 vol_ext_cli = VOLUMES_EXTENSIONS_CLIENTS[interface](*client_args)
298 self.volumes_extensions_client = vol_ext_cli
Vincent Hou22f03c72012-08-24 17:55:13 +0800299 self.floating_ips_client = FLOAT_CLIENTS[interface](*client_args)
Attila Fazekas36b1fcf2013-01-31 16:41:04 +0100300 self.snapshots_client = SNAPSHOTS_CLIENTS[interface](*client_args)
Matthew Treinish9854d5b2012-09-20 10:22:13 -0400301 self.volumes_client = VOLUMES_CLIENTS[interface](*client_args)
Attila Fazekas3dcdae12013-02-14 12:50:04 +0100302 self.volume_types_client = \
303 VOLUME_TYPES_CLIENTS[interface](*client_args)
Attila Fazekas407b6db2013-01-19 12:48:36 +0100304 self.identity_client = IDENTITY_CLIENT[interface](*client_args)
rajalakshmi-ganesan7312bb52013-01-29 20:03:42 +0530305 self.identity_v3_client = \
306 IDENTITY_V3_CLIENT[interface](*client_args)
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800307 self.token_client = TOKEN_CLIENT[interface](self.config)
Vincent Houead03dc2012-08-24 21:35:11 +0800308 self.security_groups_client = \
309 SECURITY_GROUPS_CLIENT[interface](*client_args)
Dan Smith8ad1c472013-02-26 13:03:16 -0500310 self.interfaces_client = INTERFACES_CLIENT[interface](*client_args)
rajalakshmi-ganesanab426722013-02-08 15:49:15 +0530311 self.endpoints_client = ENDPOINT_CLIENT[interface](*client_args)
Mauro S. M. Rodriguesf5166402013-04-01 10:25:26 -0400312 self.fixed_ips_client = FIXED_IPS_CLIENT[interface](*client_args)
Leo Toyodaa5278912013-04-16 15:40:12 +0900313 self.availability_zone_client = \
314 AVAILABILITY_ZONE_CLIENT[interface](*client_args)
harika-vakadia92dd742013-02-19 20:41:22 +0530315 self.service_client = SERVICE_CLIENT[interface](*client_args)
Mitsuhiko Yamazakiae8fc532013-04-22 11:17:35 +0900316 self.aggregates_client = AGGREGATES_CLIENT[interface](*client_args)
Leo Toyoda3ae31e12013-04-19 11:19:57 +0900317 self.services_client = SERVICES_CLIENT[interface](*client_args)
Leo Toyodad80b6a02013-05-08 12:15:13 +0900318 self.tenant_usages_client = \
319 TENANT_USAGES_CLIENT[interface](*client_args)
harika-vakadi40e10112013-02-08 14:38:09 +0530320 self.policy_client = POLICY_CLIENT[interface](*client_args)
Tony Yang3d5f1632013-06-06 14:17:57 +0800321 self.hypervisor_client = HYPERVISOR_CLIENT[interface](*client_args)
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500322
323 if client_args_v3_auth:
324 self.servers_client_v3_auth = SERVERS_CLIENTS[interface](
325 *client_args_v3_auth)
326 else:
327 self.servers_client_v3_auth = None
328
Dan Smithcf8fab62012-08-14 08:03:48 -0700329 except KeyError:
330 msg = "Unsupported interface type `%s'" % interface
331 raise exceptions.InvalidConfiguration(msg)
Unmesh Gurjar44986832012-05-08 19:57:10 +0530332 self.network_client = NetworkClient(*client_args)
Attila Fazekas8e99b992013-02-24 09:53:23 +0100333 self.hosts_client = HostsClientJSON(*client_args)
dwalleck5d734432012-10-04 01:11:47 -0500334 self.account_client = AccountClient(*client_args)
Matthew Treinish72ea4422013-02-07 14:42:49 -0500335 self.image_client = ImageClientJSON(*client_args)
Matthew Treinisha62347f2013-03-01 16:37:30 -0500336 self.image_client_v2 = ImageClientV2JSON(*client_args)
dwalleck5d734432012-10-04 01:11:47 -0500337 self.container_client = ContainerClient(*client_args)
338 self.object_client = ObjectClient(*client_args)
Steve Bakerc60e4e32013-05-06 15:22:41 +1200339 self.orchestration_client = OrchestrationClient(*client_args)
Attila Fazekas1aed6202013-02-11 14:47:45 +0100340 self.ec2api_client = botoclients.APIClientEC2(*client_args)
341 self.s3_client = botoclients.ObjectClientS3(*client_args)
harika-vakadi1a9ad612012-12-14 19:12:08 +0530342 self.custom_object_client = ObjectClientCustomizedHeader(*client_args)
harika-vakadi2daed0a2013-01-01 20:51:39 +0530343 self.custom_account_client = \
344 AccountClientCustomizedHeader(*client_args)
Jay Pipes50677282012-01-06 15:39:20 -0500345
346
Jay Pipesff10d552012-04-06 14:18:50 -0400347class AltManager(Manager):
348
349 """
350 Manager object that uses the alt_XXX credentials for its
351 managed client objects
352 """
353
354 def __init__(self):
Jay Pipesf38eaac2012-06-21 13:37:35 -0400355 conf = config.TempestConfig()
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100356 super(AltManager, self).__init__(conf.identity.alt_username,
357 conf.identity.alt_password,
358 conf.identity.alt_tenant_name)
Jay Pipesff10d552012-04-06 14:18:50 -0400359
360
361class AdminManager(Manager):
362
363 """
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100364 Manager object that uses the admin credentials for its
Jay Pipesff10d552012-04-06 14:18:50 -0400365 managed client objects
366 """
367
James E. Blaire6d8ee12013-01-18 21:33:45 +0000368 def __init__(self, interface='json'):
Jay Pipesf38eaac2012-06-21 13:37:35 -0400369 conf = config.TempestConfig()
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100370 super(AdminManager, self).__init__(conf.identity.admin_username,
371 conf.identity.admin_password,
372 conf.identity.admin_tenant_name,
James E. Blaire6d8ee12013-01-18 21:33:45 +0000373 interface=interface)
Jay Pipesff10d552012-04-06 14:18:50 -0400374
375
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100376class ComputeAdminManager(Manager):
377
378 """
379 Manager object that uses the compute_admin credentials for its
380 managed client objects
381 """
382
383 def __init__(self, interface='json'):
384 conf = config.TempestConfig()
385 base = super(ComputeAdminManager, self)
386 base.__init__(conf.compute_admin.username,
387 conf.compute_admin.password,
388 conf.compute_admin.tenant_name,
389 interface=interface)
Steve Bakerc60e4e32013-05-06 15:22:41 +1200390
391
392class OrchestrationManager(Manager):
393 """
394 Manager object that uses the admin credentials for its
395 so that heat templates can create users
396 """
397 def __init__(self, interface='json'):
398 conf = config.TempestConfig()
399 base = super(OrchestrationManager, self)
400 base.__init__(conf.identity.admin_username,
401 conf.identity.admin_password,
Steve Bakerfd86f3c2013-06-28 12:51:20 +1200402 conf.identity.tenant_name,
Steve Bakerc60e4e32013-05-06 15:22:41 +1200403 interface=interface)