fix flake8
This commit is contained in:
parent
eba7cbd126
commit
752c76ab7d
1 changed files with 7 additions and 6 deletions
13
util/koji-gc
13
util/koji-gc
|
|
@ -669,7 +669,7 @@ def handle_delete(just_salvage=False):
|
||||||
history = session.queryHistory(tables=['tag_listing'],
|
history = session.queryHistory(tables=['tag_listing'],
|
||||||
tag=trashcan_tag,
|
tag=trashcan_tag,
|
||||||
active=True,
|
active=True,
|
||||||
before=time.time()-grace_period)
|
before=time.time() - grace_period)
|
||||||
# simulate needed binfo fields
|
# simulate needed binfo fields
|
||||||
binfos = history['tag_listing']
|
binfos = history['tag_listing']
|
||||||
for binfo in binfos:
|
for binfo in binfos:
|
||||||
|
|
@ -725,17 +725,18 @@ def handle_delete(just_salvage=False):
|
||||||
else:
|
else:
|
||||||
# go ahead and delete
|
# go ahead and delete
|
||||||
with session.multicall(batch=100) as m:
|
with session.multicall(batch=100) as m:
|
||||||
untags = {nvr: m.untagBuildBypass(trashcan_tag, to_check[nvr]['id']) for nvr in to_check}
|
untags = {nvr: m.untagBuildBypass(trashcan_tag, to_check[nvr]['id'])
|
||||||
|
for nvr in to_check}
|
||||||
deletes = {nvr: m.deleteBuild(to_check[nvr]['id']) for nvr in to_check}
|
deletes = {nvr: m.deleteBuild(to_check[nvr]['id']) for nvr in to_check}
|
||||||
for nvr in sorted(to_check):
|
for nvr in sorted(to_check):
|
||||||
# check multicall results
|
# check multicall results
|
||||||
try:
|
try:
|
||||||
r = untags[nvr].result
|
untags[nvr].result
|
||||||
except GenericError as e:
|
except koji.GenericError as e:
|
||||||
print(f"Failed to untag {nvr} from trashcan: {e}")
|
print(f"Failed to untag {nvr} from trashcan: {e}")
|
||||||
try:
|
try:
|
||||||
r = deletes[nvr].result
|
deletes[nvr].result
|
||||||
except GenericError as e:
|
except koji.GenericError as e:
|
||||||
print(f"Warning: deletion failed for {nvr}: ({e})")
|
print(f"Warning: deletion failed for {nvr}: ({e})")
|
||||||
continue
|
continue
|
||||||
print(f"Deleted build: {nvr}")
|
print(f"Deleted build: {nvr}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue