| |
@@ -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')
|
| |
Fixes: https://pagure.io/koji/issue/1888