Beispiel #1
0
 def _fix_delete(self, context, row):
     res_map = self._resources_func_map[row.resource_type]
     ovn_obj = res_map['ovn_get'](row.resource_uuid)
     if not ovn_obj:
         revision_numbers_db.delete_revision(
             context, row.resource_uuid, row.resource_type)
     else:
         res_map['ovn_delete'](context, row.resource_uuid)
 def test_delete_revision(self):
     self._create_initial_revision(self.net['id'], ovn_rn_db.TYPE_NETWORKS)
     ovn_rn_db.delete_revision(self.ctx, self.net['id'],
                               ovn_rn_db.TYPE_NETWORKS)
     row = ovn_rn_db.get_revision_row(self.ctx, self.net['id'])
     self.assertIsNone(row)