ZhiQiang Fan | 39f9722 | 2013-09-20 04:49:44 +0800 | [diff] [blame] | 1 | # Copyright 2012 OpenStack Foundation |
Jay Pipes | 051075a | 2012-04-28 17:39:37 -0400 | [diff] [blame] | 2 | # 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 Pipes | 051075a | 2012-04-28 17:39:37 -0400 | [diff] [blame] | 16 | from tempest import exceptions |
Jay Pipes | 051075a | 2012-04-28 17:39:37 -0400 | [diff] [blame] | 17 | |
| 18 | |
| 19 | class 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 Newby | dec13ec | 2012-08-30 11:19:17 -0700 | [diff] [blame] | 29 | self.client_attr_names = [] |
Jay Pipes | 051075a | 2012-04-28 17:39:37 -0400 | [diff] [blame] | 30 | |
Sean Dague | 43cd905 | 2013-07-19 12:20:04 -0400 | [diff] [blame] | 31 | # 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) |