Beispiel #1
0
 def VM_start(self, _1, ref, _2, _3):
     vm = fake.get_record('VM', ref)
     if vm['power_state'] != 'Halted':
         raise fake.Failure(
             ['VM_BAD_POWER_STATE', ref, 'Halted', vm['power_state']])
     vm['power_state'] = 'Running'
     vm['is_a_template'] = False
     vm['is_control_domain'] = False
     vm['domid'] = random.randrange(1, 1 << 16)
Beispiel #2
0
 def VDI_introduce(self, _1, uuid, _2, _3, _4, _5, _6, _7, _8, _9, _10,
                   _11):
     valid_vdi = False
     refs = fake.get_all('VDI')
     for ref in refs:
         rec = fake.get_record('VDI', ref)
         if rec['uuid'] == uuid:
             valid_vdi = True
     if not valid_vdi:
         raise fake.Failure([['INVALID_VDI', 'session', self._session]])
Beispiel #3
0
 def VDI_introduce(self, _1, uuid, _2, _3, _4, _5, _6, _7, _8, _9, _10,
                   _11):
     # This is for testing failure
     raise fake.Failure([['INVALID_VDI', 'session', self._session]])
Beispiel #4
0
 def f(cls, *args):
     raise fake.Failure("Test Exception raised by " + "fake create_vm")
Beispiel #5
0
 def f(cls, *args):
     raise fake.Failure("Test Exception raised by " +
                        "fake fetch_image_tank_disk")