Revision def6577f lib/ssconf.py
b/lib/ssconf.py | ||
---|---|---|
65 | 65 |
constants.SS_UID_POOL, |
66 | 66 |
constants.SS_NODEGROUPS, |
67 | 67 |
constants.SS_NETWORKS, |
68 |
constants.SS_HVPARAMS_XEN_PVM, |
|
69 |
constants.SS_HVPARAMS_XEN_FAKE, |
|
70 |
constants.SS_HVPARAMS_XEN_HVM, |
|
71 |
constants.SS_HVPARAMS_XEN_KVM, |
|
72 |
constants.SS_HVPARAMS_XEN_CHROOT, |
|
73 |
constants.SS_HVPARAMS_XEN_LXC, |
|
68 | 74 |
]) |
69 | 75 |
|
70 | 76 |
#: Maximum size for ssconf files |
... | ... | |
315 | 321 |
nl = data.splitlines(False) |
316 | 322 |
return nl |
317 | 323 |
|
324 |
def GetHvparamsForHypervisor(self, hvname): |
|
325 |
"""Return the hypervisor parameters of the given hypervisor. |
|
326 |
|
|
327 |
@type hvname: string |
|
328 |
@param hvname: name of the hypervisor, must be in C{constants.HYPER_TYPES} |
|
329 |
@rtype: dict of strings |
|
330 |
@returns: dictionary with hypervisor parameters |
|
331 |
|
|
332 |
""" |
|
333 |
data = self._ReadFile(constants.SS_HVPARAMS_PREF + hvname) |
|
334 |
lines = data.splitlines(False) |
|
335 |
hvparams = {} |
|
336 |
for line in lines: |
|
337 |
(key, value) = line.split("=") |
|
338 |
hvparams[key] = value |
|
339 |
return hvparams |
|
340 |
|
|
341 |
def GetHvparams(self): |
|
342 |
"""Return the hypervisor parameters of all hypervisors. |
|
343 |
|
|
344 |
@rtype: dict of dict of strings |
|
345 |
@returns: dictionary mapping hypervisor names to hvparams |
|
346 |
|
|
347 |
""" |
|
348 |
all_hvparams = {} |
|
349 |
for hv in constants.HYPER_TYPES: |
|
350 |
all_hvparams[hv] = self.GetHvparamsForHypervisor(hv) |
|
351 |
return all_hvparams |
|
352 |
|
|
318 | 353 |
def GetMaintainNodeHealth(self): |
319 | 354 |
"""Return the value of the maintain_node_health option. |
320 | 355 |
|
Also available in: Unified diff