xenapi: move session into new client module

This is the start of building a set of objects on top of the XenAPI
library to make a clear separation between XenAPI client and
business logic.

This is all the first steps towards pull out the client lib into oslo
incubator, so we can share code between Nova and Cinder.

DocImpact
While there is a change to the sample config file, there is no change in
the content of the config file.

Part of blueprint xenapi-driver-refactor
Change-Id: I463923a9ee289ff4b86fcf26d8c656609685857e
This commit is contained in:
John Garbutt
2013-10-21 17:49:00 +01:00
committed by Gerrit Code Review
parent db86ec9237
commit fbfe555ef5
8 changed files with 345 additions and 312 deletions

View File

@@ -21,7 +21,7 @@ import random
from nova.openstack.common import jsonutils
from nova import test
import nova.tests.image.fake
from nova.virt.xenapi import driver as xenapi_conn
from nova.virt.xenapi.client import session
from nova.virt.xenapi import fake
from nova.virt.xenapi import vm_utils
from nova.virt.xenapi import vmops
@@ -55,9 +55,9 @@ def stubout_instance_snapshot(stubs):
def stubout_session(stubs, cls, product_version=(5, 6, 2),
product_brand='XenServer', **opt_args):
"""Stubs out methods from XenAPISession."""
stubs.Set(xenapi_conn.XenAPISession, '_create_session',
stubs.Set(session.XenAPISession, '_create_session',
lambda s, url: cls(url, **opt_args))
stubs.Set(xenapi_conn.XenAPISession, '_get_product_version_and_brand',
stubs.Set(session.XenAPISession, '_get_product_version_and_brand',
lambda s: (product_version, product_brand))