-
Notifications
You must be signed in to change notification settings - Fork 9
/
locals.py.in
85 lines (70 loc) · 2.38 KB
/
locals.py.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import os
# do not touch these, it is just set of constants exported from this module
URL = ''
USERNAME = ''
PASSWORD = ''
KERBEROS = False
CA_FILE = ''
CLUSTER_NAME = ''
HOST_NAME = ''
DOMAIN = ''
NFS_VM = ''
HOST = ''
TEMPLATE_NAME = ''
IP_BASE = ''
BACKEND = ''
REQUIRE_ROOT = False
# Set to your default LAB
DEFAULT_LOCATION = 'LAB1'
MB = 1024 * 1024
GB = 1024 * MB
MEMORY = 2 * GB
# feel free to override this
USER = os.environ['USER']
PRIVATE_KEY = '%s/.ssh/id_rsa' % os.environ['HOME']
DEBUG = False
def set_locale(lab):
global URL, USERNAME, PASSWORD, CA_FILE, CLUSTER_NAME, HOST_NAME, DOMAIN
global NFS_VM, HOST, TEMPLATE_NAME, IP_BASE, BACKEND, REQUIRE_ROOT
global SNAPSHOT_NAME, KERBEROS
if lab == 'LAB1':
URL = 'https://rhevm.example.com/api'
USERNAME = 'admin@example'
PASSWORD = 'adminpass'
CA_FILE = '/path/to/cert.crt'
CLUSTER_NAME = 'CLUSTER'
HOST_NAME = 'HOST'
DOMAIN = 'example.com'
NFS_VM = 'nfsvm' # virtual machine that handles NFS,
# this is used for speeding up
HOST = None # set to particular HOST to enforce VM being pinned there
TEMPLATE_NAME = 'template-name'
IP_BASE = '192.168.10.'
BACKEND = 'RHEVM' # set this to the name of the Backend class
elif lab == 'LAB2':
URL = 'https://rhevm.example.com/api'
USERNAME = 'admin@example'
PASSWORD = 'adminpass'
CA_FILE = '/path/to/cert.crt'
CLUSTER_NAME = 'CLUSTER'
HOST_NAME = 'HOST'
DOMAIN = 'example.com'
NFS_VM = 'nfsvm' # virtual machine that handles NFS,
# this is used for speeding up
HOST = None # set to particular HOST to enforce VM being pinned there
TEMPLATE_NAME = 'template-name'
IP_BASE = '192.168.11.'
BACKEND = 'RHEVM' # set this to the name of the Backend class
elif lab == 'LOC':
IP_BASE = '192.168.122.'
TEMPLATE_NAME = 'F19-temp'
BACKEND = 'LibVirt' # set this to the name of the Backend class
REQUIRE_ROOT = True # True for local labs, for autoconnection
else:
raise ValueError("Wrong lab %s" % lab)
try:
open(CA_FILE).read()
except Exception as ex:
print('CA_FILE %s is not readable' % CA_FILE)
print('Install a CA certificate used for RHEV-M API TLS connection')
raise ex