示例#1
0
def get_vms_connection(connection_type):
    # Configure the logger regardless of the type of connection that will be used.
    logger.setup_for_library()
    if connection_type == 'xenapi':
        return XenApiConnection()
    elif connection_type == 'libvirt':
        return LibvirtConnection()
    elif connection_type == 'fake':
        return DummyConnection()
    else:
        raise exception.Error(_('Unsupported connection type "%s"' % connection_type))
示例#2
0
文件: vmsapi.py 项目: rmahmood/cobalt
 def configure_logger(self):
     logger.setup_for_library()
示例#3
0
 def configure_logger(self):
     logger.setup_for_library()