blob: e3aeb317e91557db92b8eff2f05e24fdc02170fa [file] [log] [blame]
Jay Pipes051075a2012-04-28 17:39:37 -04001# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
ZhiQiang Fan39f97222013-09-20 04:49:44 +08003# Copyright 2012 OpenStack Foundation
Jay Pipes051075a2012-04-28 17:39:37 -04004# 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
Jay Pipes051075a2012-04-28 17:39:37 -040018import tempest.config
19from tempest import exceptions
Jay Pipes051075a2012-04-28 17:39:37 -040020
21
22class Manager(object):
23
24 """
25 Base manager class
26
27 Manager objects are responsible for providing a configuration object
28 and a client object for a test case to use in performing actions.
29 """
30
31 def __init__(self):
32 self.config = tempest.config.TempestConfig()
Maru Newbydec13ec2012-08-30 11:19:17 -070033 self.client_attr_names = []
Jay Pipes051075a2012-04-28 17:39:37 -040034
Sean Dague43cd9052013-07-19 12:20:04 -040035 # we do this everywhere, have it be part of the super class
36 def _validate_credentials(self, username, password, tenant_name):
37 if None in (username, password, tenant_name):
38 msg = ("Missing required credentials. "
39 "username: %(u)s, password: %(p)s, "
40 "tenant_name: %(t)s" %
41 {'u': username, 'p': password, 't': tenant_name})
42 raise exceptions.InvalidConfiguration(msg)