#1893 raise GenericError on existing build reservation
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji issue1888  into  master

file modified
+6 -1
@@ -5795,7 +5795,7 @@ 

  def cg_init_build(cg, data):

      """Create (reserve) a build_id for given data.

  

-     If build already exists, init_build will raise GenericError

+     If build or reservation already exists, init_build will raise GenericError

  

      :param str cg: content generator name

      :param dict data: build data same as for new_build, for given usecase
@@ -5812,6 +5812,11 @@ 

      # CGs shouldn't have to worry about epoch

      data.setdefault('epoch', None)

      build_id = new_build(data, strict=False)

+ 

+     # check potentially existing token

+     if get_reservation_token(build_id):

+         raise koji.GenericError("Build is already reserved")

+ 

      # store token

      token = generate_token()

      insert = InsertProcessor(table='build_reservations')

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

2 years ago

Commit 7064020 fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

2 years ago