diff --git a/roles/bodhi2/backend/files/new-updates-sync b/roles/bodhi2/backend/files/new-updates-sync index 3619e6c..5f00b29 100755 --- a/roles/bodhi2/backend/files/new-updates-sync +++ b/roles/bodhi2/backend/files/new-updates-sync @@ -367,10 +367,13 @@ def determine_last_link(release, repo): if repo == 'rawhide': source_path = os.path.join(RAWHIDESOURCE,
RELEASES[release]['repos'][repo]['from']) + #Since latest-Fedora-Rawhide is not a symlink + #we need the absolute path + target = os.path.realpath(source_path) else: source_path = os.path.join(SOURCE,
RELEASES[release]['repos'][repo]['from']) - target = os.readlink(source_path) + target = os.readlink(source_path) logger.info('Release %s, repo %s, target %s', release, repo, target) RELEASES[release]['repos'][repo]['from'] = target return target
Better wording of the comment:
diff --git a/roles/bodhi2/backend/files/new-updates-sync b/roles/bodhi2/backend/files/new-updates-sync index 3619e6c..ae78b45 100755 --- a/roles/bodhi2/backend/files/new-updates-sync +++ b/roles/bodhi2/backend/files/new-updates-sync @@ -367,10 +367,14 @@ def determine_last_link(release, repo): if repo == 'rawhide': source_path = os.path.join(RAWHIDESOURCE,
RELEASES[release]['repos'][repo]['from']) + #Since latest-Fedora-Rawhide is a symlink pointing to just the + #compose dir rather than its full path, we need the absolute path + #of the compose rather than relative path + target = os.path.realpath(source_path) else: source_path = os.path.join(SOURCE,
RELEASES[release]['repos'][repo]['from']) - target = os.readlink(source_path) + target = os.readlink(source_path) logger.info('Release %s, repo %s, target %s', release, repo, target) RELEASES[release]['repos'][repo]['from'] = target return target
On Tue, Aug 28, 2018 at 12:51 PM Mohan Boddu mboddu@bhujji.com wrote:
diff --git a/roles/bodhi2/backend/files/new-updates-sync b/roles/bodhi2/backend/files/new-updates-sync index 3619e6c..5f00b29 100755 --- a/roles/bodhi2/backend/files/new-updates-sync +++ b/roles/bodhi2/backend/files/new-updates-sync @@ -367,10 +367,13 @@ def determine_last_link(release, repo): if repo == 'rawhide': source_path = os.path.join(RAWHIDESOURCE,
RELEASES[release]['repos'][repo]['from'])
#Since latest-Fedora-Rawhide is not a symlink
#we need the absolute path
else: source_path = os.path.join(SOURCE,target = os.path.realpath(source_path)
RELEASES[release]['repos'][repo]['from'])
- target = os.readlink(source_path)
logger.info('Release %s, repo %s, target %s', release, repo, target) RELEASES[release]['repos'][repo]['from'] = target return targettarget = os.readlink(source_path)
LGTM - one comment below
On 08/28/2018 12:59 PM, Mohan Boddu wrote:
Better wording of the comment:
diff --git a/roles/bodhi2/backend/files/new-updates-sync b/roles/bodhi2/backend/files/new-updates-sync index 3619e6c..ae78b45 100755 --- a/roles/bodhi2/backend/files/new-updates-sync +++ b/roles/bodhi2/backend/files/new-updates-sync @@ -367,10 +367,14 @@ def determine_last_link(release, repo): if repo == 'rawhide': source_path = os.path.join(RAWHIDESOURCE, RELEASES[release]['repos'][repo]['from']) + #Since latest-Fedora-Rawhide is a symlink pointing to just the + #compose dir rather than its full path, we need the absolute path + #of the compose rather than relative path + target = os.path.realpath(source_path) else: source_path = os.path.join(SOURCE, RELEASES[release]['repos'][repo]['from']) - target = os.readlink(source_path) + target = os.readlink(source_path)
^^ this was a spacing change?
logger.info http://logger.info('Release %s, repo %s, target %s', release, repo, target) RELEASES[release]['repos'][repo]['from'] = target return target
@dustymabe, Yes (throwing it under else part), since we want it to calculate the path using os.path.realpath(source_path) only if its rawhide, or else use os.readlink(source_path).
Just for understanding purposes: $ ls -la /mnt/koji/compose/updates/f28-updates lrwxrwxrwx. 1 apache apache 54 Aug 27 00:54 /mnt/koji/compose/updates/f28-updates -> /mnt/koji/compose/updates/Fedora-28-updates-20180826.0
$ls -la /mnt/koji/compose/rawhide/latest-Fedora-Rawhide lrwxrwxrwx. 1 root root 27 Aug 27 17:09 /mnt/koji/compose/rawhide/latest-Fedora-Rawhide -> Fedora-Rawhide-20180827.n.0
On Tue, Aug 28, 2018 at 1:10 PM Dusty Mabe dusty@dustymabe.com wrote:
LGTM - one comment below
On 08/28/2018 12:59 PM, Mohan Boddu wrote:
Better wording of the comment:
diff --git a/roles/bodhi2/backend/files/new-updates-sync
b/roles/bodhi2/backend/files/new-updates-sync
index 3619e6c..ae78b45 100755 --- a/roles/bodhi2/backend/files/new-updates-sync +++ b/roles/bodhi2/backend/files/new-updates-sync @@ -367,10 +367,14 @@ def determine_last_link(release, repo): if repo == 'rawhide': source_path = os.path.join(RAWHIDESOURCE,
RELEASES[release]['repos'][repo]['from'])
#Since latest-Fedora-Rawhide is a symlink pointing to just the
#compose dir rather than its full path, we need the absolute
path
#of the compose rather than relative path
else: source_path = os.path.join(SOURCE,target = os.path.realpath(source_path)
RELEASES[release]['repos'][repo]['from'])
- target = os.readlink(source_path)
target = os.readlink(source_path)
^^ this was a spacing change?
logger.info <http://logger.info>('Release %s, repo %s, target %s',
release, repo, target)
RELEASES[release]['repos'][repo]['from'] = target return target
Thanks for the explanation. I am +1 as it can be backed out On Tue, 28 Aug 2018 at 13:14, Mohan Boddu mboddu@bhujji.com wrote:
@dustymabe, Yes (throwing it under else part), since we want it to calculate the path using os.path.realpath(source_path) only if its rawhide, or else use os.readlink(source_path).
Just for understanding purposes: $ ls -la /mnt/koji/compose/updates/f28-updates lrwxrwxrwx. 1 apache apache 54 Aug 27 00:54 /mnt/koji/compose/updates/f28-updates -> /mnt/koji/compose/updates/Fedora-28-updates-20180826.0
$ls -la /mnt/koji/compose/rawhide/latest-Fedora-Rawhide lrwxrwxrwx. 1 root root 27 Aug 27 17:09 /mnt/koji/compose/rawhide/latest-Fedora-Rawhide -> Fedora-Rawhide-20180827.n.0
On Tue, Aug 28, 2018 at 1:10 PM Dusty Mabe dusty@dustymabe.com wrote:
LGTM - one comment below
On 08/28/2018 12:59 PM, Mohan Boddu wrote:
Better wording of the comment:
diff --git a/roles/bodhi2/backend/files/new-updates-sync b/roles/bodhi2/backend/files/new-updates-sync index 3619e6c..ae78b45 100755 --- a/roles/bodhi2/backend/files/new-updates-sync +++ b/roles/bodhi2/backend/files/new-updates-sync @@ -367,10 +367,14 @@ def determine_last_link(release, repo): if repo == 'rawhide': source_path = os.path.join(RAWHIDESOURCE, RELEASES[release]['repos'][repo]['from'])
#Since latest-Fedora-Rawhide is a symlink pointing to just the
#compose dir rather than its full path, we need the absolute path
#of the compose rather than relative path
else: source_path = os.path.join(SOURCE, RELEASES[release]['repos'][repo]['from'])target = os.path.realpath(source_path)
- target = os.readlink(source_path)
target = os.readlink(source_path)
^^ this was a spacing change?
logger.info <http://logger.info>('Release %s, repo %s, target %s', release, repo, target) RELEASES[release]['repos'][repo]['from'] = target return target
infrastructure mailing list -- infrastructure@lists.fedoraproject.org To unsubscribe send an email to infrastructure-leave@lists.fedoraproject.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/infrastructure@lists.fedorapro...
On 08/28/2018 01:14 PM, Mohan Boddu wrote:
@dustymabe, Yes (throwing it under else part), since we want it to calculate the path using os.path.realpath(source_path) only if its rawhide, or else use os.readlink(source_path).
Just for understanding purposes: $ ls -la /mnt/koji/compose/updates/f28-updates lrwxrwxrwx. 1 apache apache 54 Aug 27 00:54 /mnt/koji/compose/updates/f28-updates -> /mnt/koji/compose/updates/Fedora-28-updates-20180826.0
wow. I actually think that is a bug. we should probably be using a relative symlink here because if the filesystem was mounted anywhere else then the symlink would be broken.
Copying randy/lubos in case they have opinons
$ls -la /mnt/koji/compose/rawhide/latest-Fedora-Rawhide lrwxrwxrwx. 1 root root 27 Aug 27 17:09 /mnt/koji/compose/rawhide/latest-Fedora-Rawhide -> Fedora-Rawhide-20180827.n.0
infrastructure@lists.fedoraproject.org