blob: 93ff10fa13c04b1848157af463375d7fdc557562 [file] [log] [blame]
ZhiQiang Fan39f97222013-09-20 04:49:44 +08001# Copyright 2012 OpenStack Foundation
Jay Pipes051075a2012-04-28 17:39:37 -04002# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
Jay Pipes051075a2012-04-28 17:39:37 -040016from tempest import exceptions
Jay Pipes051075a2012-04-28 17:39:37 -040017
18
19class Manager(object):
20
21 """
22 Base manager class
23
24 Manager objects are responsible for providing a configuration object
25 and a client object for a test case to use in performing actions.
26 """
27
28 def __init__(self):
Maru Newbydec13ec2012-08-30 11:19:17 -070029 self.client_attr_names = []
Jay Pipes051075a2012-04-28 17:39:37 -040030
Sean Dague43cd9052013-07-19 12:20:04 -040031 # we do this everywhere, have it be part of the super class
32 def _validate_credentials(self, username, password, tenant_name):
33 if None in (username, password, tenant_name):
34 msg = ("Missing required credentials. "
35 "username: %(u)s, password: %(p)s, "
36 "tenant_name: %(t)s" %
37 {'u': username, 'p': password, 't': tenant_name})
38 raise exceptions.InvalidConfiguration(msg)