Updated with qemu mode.
This commit is contained in:
parent
38f7e13903
commit
6a2d2af8cc
@ -573,6 +573,12 @@ class NovaConfigurator(object):
|
||||
def _configure_libvirt(self, virt_type, nova_conf):
|
||||
if not virt_type:
|
||||
return
|
||||
if virt_type == 'kvm' and not sh.exists("/dev/kvm"):
|
||||
LOG.warn("No kvm found at /dev/kvm, switching to qemu mode.")
|
||||
virt_type = "qemu"
|
||||
if virt_type == 'lxc':
|
||||
#todo
|
||||
pass
|
||||
nova_conf.add('libvirt_type', virt_type)
|
||||
|
||||
#configures any virt driver settings
|
||||
|
@ -301,6 +301,10 @@ def rmdir(path, quiet=True):
|
||||
pass
|
||||
|
||||
|
||||
def exists(path):
|
||||
return os.path.exists(path)
|
||||
|
||||
|
||||
def dirname(path):
|
||||
return os.path.dirname(path)
|
||||
|
||||
|
@ -53,6 +53,10 @@ def write_line(text, fh):
|
||||
fh.write(os.linesep)
|
||||
|
||||
|
||||
def format_env(name, value):
|
||||
return "%s=%s" % (name, value)
|
||||
|
||||
|
||||
def main():
|
||||
opts = optparse.OptionParser()
|
||||
opts.add_option("-o", "--output", dest="filename",
|
||||
@ -68,7 +72,7 @@ def main():
|
||||
section = cfg_data[0]
|
||||
key = cfg_data[1]
|
||||
value = cfg.get(section, key)
|
||||
write_line("%s=%s" % (out_name, value), fh)
|
||||
write_line(format_env(out_name, value), fh)
|
||||
print("Check file \"%s\" for your environment configuration." % (os.path.normpath(fn)))
|
||||
return 0
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user