Ejemplo n.º 1
0
 def test_action_finish_no_result(self):
     timeutils.set_time_override()
     self.mox.StubOutWithMock(db, 'action_finish')
     db.action_finish(self.context, compute_utils.pack_action_finish(
             self.context, 'fake-uuid')).AndReturn(fake_action)
     self.mox.ReplayAll()
     action = instance_action.InstanceAction.action_finish(
         self.context, 'fake-uuid', want_result=False)
     self.assertEqual(None, action)
Ejemplo n.º 2
0
 def test_action_finish(self):
     timeutils.set_time_override()
     ctxt = context.get_admin_context()
     self.mox.StubOutWithMock(db, 'action_finish')
     db.action_finish(ctxt, compute_utils.pack_action_finish(
             ctxt, 'fake-uuid')).AndReturn(fake_action)
     self.mox.ReplayAll()
     action = instance_action.InstanceAction.action_finish(
         ctxt, 'fake-uuid', want_result=True)
     self.assertEqual(fake_action['id'], action.id)
Ejemplo n.º 3
0
 def test_action_finish_no_result(self):
     timeutils.set_time_override()
     self.mox.StubOutWithMock(db, 'action_finish')
     db.action_finish(
         self.context,
         compute_utils.pack_action_finish(
             self.context, 'fake-uuid')).AndReturn(fake_action)
     self.mox.ReplayAll()
     action = instance_action.InstanceAction.action_finish(
         self.context, 'fake-uuid', want_result=False)
     self.assertEqual(None, action)
Ejemplo n.º 4
0
 def test_action_finish(self):
     timeutils.set_time_override()
     ctxt = context.get_admin_context()
     self.mox.StubOutWithMock(db, 'action_finish')
     db.action_finish(ctxt,
                      compute_utils.pack_action_finish(
                          ctxt, 'fake-uuid')).AndReturn(fake_action)
     self.mox.ReplayAll()
     action = instance_action.InstanceAction.action_finish(ctxt,
                                                           'fake-uuid',
                                                           want_result=True)
     self.assertEqual(fake_action['id'], action.id)
Ejemplo n.º 5
0
 def test_finish(self):
     timeutils.set_time_override()
     self.mox.StubOutWithMock(db, 'action_start')
     self.mox.StubOutWithMock(db, 'action_finish')
     db.action_start(self.context, compute_utils.pack_action_start(
             self.context, 'fake-uuid', 'fake-action')).AndReturn(
                 fake_action)
     db.action_finish(self.context, compute_utils.pack_action_finish(
             self.context, 'fake-uuid')).AndReturn(fake_action)
     self.mox.ReplayAll()
     action = instance_action.InstanceAction.action_start(
         self.context, 'fake-uuid', 'fake-action')
     action.finish()
Ejemplo n.º 6
0
 def test_finish(self):
     timeutils.set_time_override()
     ctxt = context.get_admin_context()
     self.mox.StubOutWithMock(db, 'action_start')
     self.mox.StubOutWithMock(db, 'action_finish')
     db.action_start(
         ctxt,
         compute_utils.pack_action_start(
             ctxt, 'fake-uuid', 'fake-action')).AndReturn(fake_action)
     db.action_finish(ctxt,
                      compute_utils.pack_action_finish(
                          ctxt, 'fake-uuid')).AndReturn(fake_action)
     self.mox.ReplayAll()
     action = instance_action.InstanceAction.action_start(
         ctxt, 'fake-uuid', 'fake-action')
     action.finish()
Ejemplo n.º 7
0
 def finish(self, context):
     values = compute_utils.pack_action_finish(context, self.instance_uuid)
     db_action = db.action_finish(context, values)
     self._from_db_object(context, self, db_action)
Ejemplo n.º 8
0
 def action_finish(cls, context, instance_uuid, want_result=True):
     values = compute_utils.pack_action_finish(context, instance_uuid)
     db_action = db.action_finish(context, values)
     if want_result:
         return cls._from_db_object(context, cls(), db_action)
Ejemplo n.º 9
0
 def finish(self):
     values = self.pack_action_finish(self._context, self.instance_uuid)
     db_action = db.action_finish(self._context, values)
     self._from_db_object(self._context, self, db_action)
Ejemplo n.º 10
0
 def action_finish(cls, context, instance_uuid, want_result=True):
     values = cls.pack_action_finish(context, instance_uuid)
     db_action = db.action_finish(context, values)
     if want_result:
         return cls._from_db_object(context, cls(), db_action)
Ejemplo n.º 11
0
 def finish(self):
     values = self.pack_action_finish(self._context, self.instance_uuid)
     db_action = db.action_finish(self._context, values)
     self._from_db_object(self._context, self, db_action)
Ejemplo n.º 12
0
 def finish(self, context):
     values = compute_utils.pack_action_finish(context, self.instance_uuid)
     db_action = db.action_finish(context, values)
     self._from_db_object(context, self, db_action)