Merge "Remove unnecessary db call from xenapi/vmops"
This commit is contained in:
@@ -1488,6 +1488,11 @@ class XenAPIGenerateLocal(stubs.XenAPITestBase):
|
||||
instance = db.instance_update(self.context, instance['uuid'],
|
||||
{'instance_type_id': 5})
|
||||
|
||||
# NOTE(danms): because we're stubbing out the instance_types from
|
||||
# the database, our instance['instance_type'] doesn't get properly
|
||||
# filled out here, so put what we need into it
|
||||
instance['instance_type']['swap'] = 1024
|
||||
|
||||
def fake_generate_swap(*args, **kwargs):
|
||||
self.called = True
|
||||
self.stubs.Set(vm_utils, 'generate_swap', fake_generate_swap)
|
||||
@@ -1500,6 +1505,11 @@ class XenAPIGenerateLocal(stubs.XenAPITestBase):
|
||||
instance = db.instance_update(self.context, instance['uuid'],
|
||||
{'instance_type_id': 4})
|
||||
|
||||
# NOTE(danms): because we're stubbing out the instance_types from
|
||||
# the database, our instance['instance_type'] doesn't get properly
|
||||
# filled out here, so put what we need into it
|
||||
instance['instance_type']['ephemeral_gb'] = 160
|
||||
|
||||
def fake_generate_ephemeral(*args):
|
||||
self.called = True
|
||||
self.stubs.Set(vm_utils, 'generate_ephemeral', fake_generate_ephemeral)
|
||||
|
||||
Reference in New Issue
Block a user