Chetan Gaonker | 80933a0 | 2017-02-15 02:04:34 +0000 | [diff] [blame] | 1 | import os |
| 2 | |
| 3 | def get_credentials(): |
| 4 | n = {} |
| 5 | n['username'] = os.environ['OS_USERNAME'] |
| 6 | n['password'] = os.environ['OS_PASSWORD'] |
| 7 | n['auth_url'] = os.environ['OS_AUTH_URL'] |
| 8 | n['tenant_name'] = os.environ['OS_TENANT_NAME'] |
| 9 | return n |
| 10 | |
| 11 | def get_cinder_credentials(): |
| 12 | n = [os.environ['OS_USERNAME'], os.environ['OS_PASSWORD'], |
| 13 | os.environ['OS_TENANT_NAME'], os.environ['OS_AUTH_URL']] |
| 14 | return n |
| 15 | |
| 16 | def get_ceilo_credentials(): |
| 17 | n = {} |
| 18 | n['os_username'] = os.environ['OS_USERNAME'] |
| 19 | n['os_password'] = os.environ['OS_PASSWORD'] |
| 20 | n['os_auth_url'] = os.environ['OS_AUTH_URL'] |
| 21 | n['os_tenant_name'] = os.environ['OS_TENANT_NAME'] |
| 22 | return n |
| 23 | |
| 24 | def get_nova_credentials(): |
| 25 | n = {} |
| 26 | n['username'] = os.environ['OS_USERNAME'] |
| 27 | n['api_key'] = os.environ['OS_PASSWORD'] |
| 28 | n['auth_url'] = os.environ['OS_AUTH_URL'] |
| 29 | n['project_id'] = os.environ['OS_TENANT_NAME'] |
| 30 | return n |
| 31 | |
| 32 | def get_nova_credentials_v2(): |
| 33 | n = {} |
| 34 | n['version'] = '2' |
| 35 | n['username'] = os.environ['OS_USERNAME'] |
| 36 | n['api_key'] = os.environ['OS_PASSWORD'] |
| 37 | n['auth_url'] = os.environ['OS_AUTH_URL'] |
| 38 | n['project_id'] = os.environ['OS_TENANT_NAME'] |
| 39 | return n |
| 40 | |
| 41 | def get_nova_credentials_v3(): |
| 42 | n = {} |
| 43 | n['version'] = '3' |
| 44 | n['username'] = os.environ['OS_USERNAME'] |
| 45 | n['password'] = os.environ['OS_PASSWORD'] |
| 46 | n['project_id'] = os.environ['OS_TENANT_NAME'] |
| 47 | n['auth_url'] = os.environ['OS_AUTH_URL'] |
| 48 | return n |
| 49 | |
| 50 | def get_nova_credentials_v11(): |
| 51 | n = {} |
| 52 | n['version'] = '1.1' |
| 53 | n['username'] = os.environ['OS_USERNAME'] |
| 54 | n['api_key'] = os.environ['OS_PASSWORD'] |
| 55 | n['auth_url'] = os.environ['OS_AUTH_URL'] |
| 56 | n['project_id'] = os.environ['OS_TENANT_NAME'] |
| 57 | return n |