blob: 1035b7d6cf6209ee0c0402637236ea556a5d52d1 [file] [log] [blame]
Matteo Scandolo48d3d2d2017-08-08 13:05:27 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain 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,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Chetan Gaonker80933a02017-02-15 02:04:34 +000017import os
18
19def get_credentials():
20 n = {}
21 n['username'] = os.environ['OS_USERNAME']
22 n['password'] = os.environ['OS_PASSWORD']
23 n['auth_url'] = os.environ['OS_AUTH_URL']
24 n['tenant_name'] = os.environ['OS_TENANT_NAME']
25 return n
26
27def get_cinder_credentials():
28 n = [os.environ['OS_USERNAME'], os.environ['OS_PASSWORD'],
29 os.environ['OS_TENANT_NAME'], os.environ['OS_AUTH_URL']]
30 return n
31
32def get_ceilo_credentials():
33 n = {}
34 n['os_username'] = os.environ['OS_USERNAME']
35 n['os_password'] = os.environ['OS_PASSWORD']
36 n['os_auth_url'] = os.environ['OS_AUTH_URL']
37 n['os_tenant_name'] = os.environ['OS_TENANT_NAME']
38 return n
39
40def get_nova_credentials():
41 n = {}
42 n['username'] = os.environ['OS_USERNAME']
43 n['api_key'] = os.environ['OS_PASSWORD']
44 n['auth_url'] = os.environ['OS_AUTH_URL']
45 n['project_id'] = os.environ['OS_TENANT_NAME']
46 return n
47
48def get_nova_credentials_v2():
49 n = {}
Chetan Gaonker80933a02017-02-15 02:04:34 +000050 n['username'] = os.environ['OS_USERNAME']
51 n['api_key'] = os.environ['OS_PASSWORD']
52 n['auth_url'] = os.environ['OS_AUTH_URL']
53 n['project_id'] = os.environ['OS_TENANT_NAME']
54 return n
55
56def get_nova_credentials_v3():
57 n = {}
58 n['version'] = '3'
59 n['username'] = os.environ['OS_USERNAME']
60 n['password'] = os.environ['OS_PASSWORD']
61 n['project_id'] = os.environ['OS_TENANT_NAME']
62 n['auth_url'] = os.environ['OS_AUTH_URL']
63 return n
64
65def get_nova_credentials_v11():
66 n = {}
67 n['version'] = '1.1'
68 n['username'] = os.environ['OS_USERNAME']
69 n['api_key'] = os.environ['OS_PASSWORD']
70 n['auth_url'] = os.environ['OS_AUTH_URL']
71 n['project_id'] = os.environ['OS_TENANT_NAME']
72 return n