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))
def configure_logger(self): logger.setup_for_library()