Merge with trunk.
This commit is contained in:
commit
1bdde8e521
@ -24,7 +24,6 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import string
|
import string
|
||||||
import sys
|
|
||||||
import tempfile
|
import tempfile
|
||||||
import uuid
|
import uuid
|
||||||
import zipfile
|
import zipfile
|
||||||
@ -325,8 +324,7 @@ class AuthManager(object):
|
|||||||
def __new__(cls, *args, **kwargs):
|
def __new__(cls, *args, **kwargs):
|
||||||
"""Returns the AuthManager singleton"""
|
"""Returns the AuthManager singleton"""
|
||||||
if not cls._instance:
|
if not cls._instance:
|
||||||
cls._instance = super(AuthManager, cls).__new__(
|
cls._instance = super(AuthManager, cls).__new__(cls)
|
||||||
cls, *args, **kwargs)
|
|
||||||
return cls._instance
|
return cls._instance
|
||||||
|
|
||||||
def __init__(self, driver=None, *args, **kwargs):
|
def __init__(self, driver=None, *args, **kwargs):
|
||||||
|
@ -48,7 +48,8 @@ import hashlib
|
|||||||
import hmac
|
import hmac
|
||||||
import logging
|
import logging
|
||||||
import urllib
|
import urllib
|
||||||
import boto
|
import boto # NOTE(vish): for new boto
|
||||||
|
import boto.utils # NOTE(vish): for old boto
|
||||||
|
|
||||||
from nova.exception import Error
|
from nova.exception import Error
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<domain type='kvm'>
|
<domain type='%(type)s'>
|
||||||
<name>%(name)s</name>
|
<name>%(name)s</name>
|
||||||
<os>
|
<os>
|
||||||
<type>hvm</type>
|
<type>hvm</type>
|
||||||
@ -12,7 +12,6 @@
|
|||||||
<memory>%(memory_kb)s</memory>
|
<memory>%(memory_kb)s</memory>
|
||||||
<vcpu>%(vcpus)s</vcpu>
|
<vcpu>%(vcpus)s</vcpu>
|
||||||
<devices>
|
<devices>
|
||||||
<emulator>/usr/bin/kvm</emulator>
|
|
||||||
<disk type='file'>
|
<disk type='file'>
|
||||||
<source file='%(basepath)s/disk'/>
|
<source file='%(basepath)s/disk'/>
|
||||||
<target dev='vda' bus='virtio'/>
|
<target dev='vda' bus='virtio'/>
|
||||||
|
@ -41,7 +41,7 @@ def import_class(import_str):
|
|||||||
try:
|
try:
|
||||||
__import__(mod_str)
|
__import__(mod_str)
|
||||||
return getattr(sys.modules[mod_str], class_str)
|
return getattr(sys.modules[mod_str], class_str)
|
||||||
except (ImportError, AttributeError):
|
except (ImportError, ValueError, AttributeError):
|
||||||
raise exception.NotFound('Class %s cannot be found' % class_str)
|
raise exception.NotFound('Class %s cannot be found' % class_str)
|
||||||
|
|
||||||
def fetchfile(url, target):
|
def fetchfile(url, target):
|
||||||
|
@ -47,6 +47,10 @@ flags.DEFINE_string('libvirt_xml_template',
|
|||||||
utils.abspath('compute/libvirt.xml.template'),
|
utils.abspath('compute/libvirt.xml.template'),
|
||||||
'Libvirt XML Template')
|
'Libvirt XML Template')
|
||||||
|
|
||||||
|
flags.DEFINE_string('libvirt_type',
|
||||||
|
'kvm',
|
||||||
|
'Libvirt domain type (kvm, qemu, etc)')
|
||||||
|
|
||||||
def get_connection(read_only):
|
def get_connection(read_only):
|
||||||
# These are loaded late so that there's no need to install these
|
# These are loaded late so that there's no need to install these
|
||||||
# libraries when not using libvirt.
|
# libraries when not using libvirt.
|
||||||
@ -235,6 +239,7 @@ class LibvirtConnection(object):
|
|||||||
|
|
||||||
# TODO(termie): lazy lazy hack because xml is annoying
|
# TODO(termie): lazy lazy hack because xml is annoying
|
||||||
xml_info['nova'] = json.dumps(instance.datamodel.copy())
|
xml_info['nova'] = json.dumps(instance.datamodel.copy())
|
||||||
|
xml_info['type'] = FLAGS.libvirt_type
|
||||||
libvirt_xml = libvirt_xml % xml_info
|
libvirt_xml = libvirt_xml % xml_info
|
||||||
logging.debug("Finished the toXML method")
|
logging.debug("Finished the toXML method")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user