From 6aaa49c63dc71ad4f0edd7c5d6fa8ab90becfe6a Mon Sep 17 00:00:00 2001 From: Pedro Moura Date: Mon, 27 Sep 2021 10:41:25 -0300 Subject: [PATCH] fix condition to check epel-release rpm symlink --- roles/bodhi2/backend/files/new-updates-sync | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/bodhi2/backend/files/new-updates-sync b/roles/bodhi2/backend/files/new-updates-sync index 4452f3057e..a2efada11c 100755 --- a/roles/bodhi2/backend/files/new-updates-sync +++ b/roles/bodhi2/backend/files/new-updates-sync @@ -460,8 +460,8 @@ def update_epel_release_latest(releases): for path in Path(RELEASES[release]['repos']['epel']['to'][0]['dest']).rglob('epel-release*noarch*'): if 'Packages' in str(path) and 'x86_64' in str(path): dest = '/pub/epel/epel-release-latest-' + release[4]+ '.noarch.rpm' - if os.path.exists(dest): - if not os.path.exists(os.path.join(EPELDEST,os.readlink(dest))): + if os.path.lexists(dest): + if not os.path.islink(dest) or not os.path.exists(os.path.join(EPELDEST,os.readlink(dest))): os.remove(dest) os.symlink(os.path.relpath(path, os.path.dirname(dest)), dest) break