Example #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))
Example #2
0
 def configure_logger(self):
     logger.setup_for_library()
Example #3
0
 def configure_logger(self):
     logger.setup_for_library()