+ return cfg.get(_INSTANCE_CHECK_KEY, None) # pylint: disable=E1103
+
+
+def GetEnabledHypervisors():
+ """Returns list of enabled hypervisors.
+
+ @rtype: list
+
+ """
+ try:
+ value = cfg[_ENABLED_HV_KEY]
+ except KeyError:
+ return [constants.DEFAULT_ENABLED_HYPERVISOR]
+ else:
+ if isinstance(value, basestring):
+ # The configuration key ("enabled-hypervisors") implies there can be
+ # multiple values. Multiple hypervisors are comma-separated on the
+ # command line option to "gnt-cluster init", so we need to handle them
+ # equally here.
+ return value.split(",")
+ else:
+ return value
+
+
+def GetDefaultHypervisor():
+ """Returns the default hypervisor to be used.
+
+ """
+ return GetEnabledHypervisors()[0]