Move product_version to XenAPISession
This keeps it together with host_uuid and is_slave Change-Id: Ib408586baec116def6c73c6cda1ff4eba15a3127
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user