Skip to content

Commit 1ebdd95

Browse files
committed
Add type hints to the data.py-dist template
Since we use this template to run check jobs, empty structs cannot be implicitly typed, mypy needs some help. Signed-off-by: Yann Dirson <[email protected]>
1 parent 83ca1dc commit 1ebdd95

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

data.py-dist

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Any, Dict
2+
13
# Configuration file, to be adapted to one's needs
24

35
# Default user and password to connect to a host through XAPI
@@ -15,7 +17,7 @@ HOST_DEFAULT_PASSWORD = ""
1517
# skip_xo_config allows to not touch XO's configuration regarding the host
1618
# Else the default behaviour is to add the host to XO servers at the beginning
1719
# of the testing session and remove it at the end.
18-
HOSTS = {
20+
HOSTS: Dict[str, Dict[str, Any]] = {
1921
# "10.0.0.1": {"user": "root", "password": ""},
2022
# "testhost1": {"user": "root", "password": "", 'skip_xo_config': True},
2123
}
@@ -106,44 +108,44 @@ DEFAULT_SR = 'default'
106108
CACHE_IMPORTED_VM = False
107109

108110
# Default NFS device config:
109-
NFS_DEVICE_CONFIG = {
111+
NFS_DEVICE_CONFIG: Dict[str, Dict[str, str]] = {
110112
# 'server': '10.0.0.2', # URL/Hostname of NFS server
111113
# 'serverpath': '/path/to/shared/mount' # Path to shared mountpoint
112114
}
113115

114116
# Default NFS4+ only device config:
115-
NFS4_DEVICE_CONFIG = {
117+
NFS4_DEVICE_CONFIG: Dict[str, Dict[str, str]] = {
116118
# 'server': '10.0.0.2', # URL/Hostname of NFS server
117119
# 'serverpath': '/path_to_shared_mount' # Path to shared mountpoint
118120
# 'nfsversion': '4.1'
119121
}
120122

121123
# Default NFS ISO device config:
122-
NFS_ISO_DEVICE_CONFIG = {
124+
NFS_ISO_DEVICE_CONFIG: Dict[str, Dict[str, str]] = {
123125
# 'location': '10.0.0.2:/path/to/shared/mount' # URL/Hostname of NFS server and path to shared mountpoint
124126
}
125127

126128
# Default CIFS ISO device config:
127-
CIFS_ISO_DEVICE_CONFIG = {
129+
CIFS_ISO_DEVICE_CONFIG: Dict[str, Dict[str, str]] = {
128130
# 'location': r'\\10.0.0.2\<shared folder name>',
129131
# 'username': '<user>',
130132
# 'cifspassword': '<password>',
131133
# 'type': 'cifs',
132134
# 'vers': '<1.0> or <3.0>'
133135
}
134136

135-
CEPHFS_DEVICE_CONFIG = {
137+
CEPHFS_DEVICE_CONFIG: Dict[str, Dict[str, str]] = {
136138
# 'server': '10.0.0.2',
137139
# 'serverpath': '/vms'
138140
}
139141

140-
MOOSEFS_DEVICE_CONFIG = {
142+
MOOSEFS_DEVICE_CONFIG: Dict[str, Dict[str, str]] = {
141143
# 'masterhost': 'mfsmaster',
142144
# 'masterport': '9421',
143145
# 'rootpath': '/vms'
144146
}
145147

146-
LVMOISCSI_DEVICE_CONFIG = {
148+
LVMOISCSI_DEVICE_CONFIG: Dict[str, Dict[str, str]] = {
147149
# 'target': '192.168.1.1',
148150
# 'port': '3260',
149151
# 'targetIQN': 'target.example',

0 commit comments

Comments
 (0)