Revision 9be1ff8c lib/constants.py
b/lib/constants.py | ||
---|---|---|
263 | 263 |
ST_LVM_VG = _constants.ST_LVM_VG |
264 | 264 |
ST_RADOS = _constants.ST_RADOS |
265 | 265 |
STORAGE_TYPES = _constants.STORAGE_TYPES |
266 |
|
|
267 |
# the set of storage types for which storage reporting is available |
|
268 |
# FIXME: Remove this, once storage reporting is available for all types. |
|
269 |
STS_REPORT = compat.UniqueFrozenset([ST_FILE, ST_LVM_PV, ST_LVM_VG]) |
|
266 |
STS_REPORT = _constants.STS_REPORT |
|
270 | 267 |
|
271 | 268 |
# Storage fields |
272 | 269 |
# first two are valid in LU context only, not passed to backend |
... | ... | |
278 | 275 |
SF_FREE = _constants.SF_FREE |
279 | 276 |
SF_USED = _constants.SF_USED |
280 | 277 |
SF_ALLOCATABLE = _constants.SF_ALLOCATABLE |
278 |
VALID_STORAGE_FIELDS = _constants.VALID_STORAGE_FIELDS |
|
279 |
MODIFIABLE_STORAGE_FIELDS = _constants.MODIFIABLE_STORAGE_FIELDS |
|
281 | 280 |
|
282 |
# Storage operations |
|
283 |
SO_FIX_CONSISTENCY = "fix-consistency" |
|
284 |
|
|
285 |
# Available fields per storage type |
|
286 |
VALID_STORAGE_FIELDS = compat.UniqueFrozenset([ |
|
287 |
SF_NODE, |
|
288 |
SF_NAME, |
|
289 |
SF_TYPE, |
|
290 |
SF_SIZE, |
|
291 |
SF_USED, |
|
292 |
SF_FREE, |
|
293 |
SF_ALLOCATABLE, |
|
294 |
]) |
|
281 |
SO_FIX_CONSISTENCY = _constants.SO_FIX_CONSISTENCY |
|
282 |
VALID_STORAGE_OPERATIONS = _constants.VALID_STORAGE_OPERATIONS |
|
295 | 283 |
|
296 |
MODIFIABLE_STORAGE_FIELDS = { |
|
297 |
ST_LVM_PV: frozenset([SF_ALLOCATABLE]), |
|
298 |
} |
|
284 |
VF_DEV = _constants.VF_DEV |
|
285 |
VF_INSTANCE = _constants.VF_INSTANCE |
|
286 |
VF_NAME = _constants.VF_NAME |
|
287 |
VF_NODE = _constants.VF_NODE |
|
288 |
VF_PHYS = _constants.VF_PHYS |
|
289 |
VF_SIZE = _constants.VF_SIZE |
|
290 |
VF_VG = _constants.VF_VG |
|
299 | 291 |
|
300 | 292 |
LDS_OKAY = _constants.LDS_OKAY |
301 | 293 |
LDS_UNKNOWN = _constants.LDS_UNKNOWN |
302 | 294 |
LDS_FAULTY = _constants.LDS_FAULTY |
303 | 295 |
LDS_NAMES = _constants.LDS_NAMES |
304 |
VALID_STORAGE_OPERATIONS = { |
|
305 |
ST_LVM_VG: frozenset([SO_FIX_CONSISTENCY]), |
|
306 |
} |
|
307 |
|
|
308 |
# Volume fields |
|
309 |
VF_DEV = "dev" |
|
310 |
VF_INSTANCE = "instance" |
|
311 |
VF_NAME = "name" |
|
312 |
VF_NODE = "node" |
|
313 |
VF_PHYS = "phys" |
|
314 |
VF_SIZE = "size" |
|
315 |
VF_VG = "vg" |
|
316 | 296 |
|
317 | 297 |
# disk template types |
318 | 298 |
DT_BLOCK = _constants.DT_BLOCK |
... | ... | |
327 | 307 |
DISK_TEMPLATES = _constants.DISK_TEMPLATES |
328 | 308 |
DEFAULT_ENABLED_DISK_TEMPLATES = _constants.DEFAULT_ENABLED_DISK_TEMPLATES |
329 | 309 |
|
330 |
# mapping of disk templates to storage types |
|
331 |
MAP_DISK_TEMPLATE_STORAGE_TYPE = { |
|
332 |
DT_BLOCK: ST_BLOCK, |
|
333 |
DT_DISKLESS: ST_DISKLESS, |
|
334 |
DT_DRBD8: ST_LVM_VG, |
|
335 |
DT_EXT: ST_EXT, |
|
336 |
DT_FILE: ST_FILE, |
|
337 |
DT_PLAIN: ST_LVM_VG, |
|
338 |
DT_RBD: ST_RADOS, |
|
339 |
DT_SHARED_FILE: ST_FILE, |
|
340 |
} |
|
341 |
|
|
342 |
|
|
310 |
MAP_DISK_TEMPLATE_STORAGE_TYPE = _constants.MAP_DISK_TEMPLATE_STORAGE_TYPE |
|
343 | 311 |
# drbd constants |
344 | 312 |
DRBD_HMAC_ALG = "md5" |
345 | 313 |
DRBD_DEFAULT_NET_PROTOCOL = "C" |
Also available in: Unified diff