Move product_version to XenAPISession

This keeps it together with host_uuid and is_slave

Change-Id: Ib408586baec116def6c73c6cda1ff4eba15a3127
This commit is contained in:
Johannes Erdfelt
2012-04-05 21:26:10 +00:00
parent 97926e51ee
commit 237366b98b

View File

@@ -53,7 +53,7 @@ def stubout_instance_snapshot(stubs):
stubs.Set(vm_utils, '_wait_for_vhd_coalesce', fake_wait_for_vhd_coalesce)
def stubout_session(stubs, cls, product_version=None, **opt_args):
def stubout_session(stubs, cls, product_version=(5, 6, 2), **opt_args):
"""Stubs out three methods from XenAPISession"""
def fake_import(self):
"""Stubs out get_imported_xenapi of XenAPISession"""
@@ -64,11 +64,9 @@ def stubout_session(stubs, cls, product_version=None, **opt_args):
stubs.Set(xenapi_conn.XenAPISession, '_create_session',
lambda s, url: cls(url, **opt_args))
stubs.Set(xenapi_conn.XenAPISession, 'get_imported_xenapi',
fake_import)
if product_version is None:
product_version = (5, 6, 2)
stubs.Set(xenapi_conn.XenAPISession, 'get_product_version',
lambda s: product_version)
fake_import)
stubs.Set(xenapi_conn.XenAPISession, '_get_product_version',
lambda s: product_version)
# NOTE(johannes): logging can't be used reliably from a thread
# since it can deadlock with eventlet. It's safe for our faked
# sessions to be called synchronously in the unit tests. (see