Re: [PATCH] rawhide ostree sync as part of new-updates-sync script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dusty, how about this:

diff --git a/roles/bodhi2/backend/files/new-updates-sync b/roles/bodhi2/backend/files/new-updates-sync
index 9ddc591..194e2bd 100755
--- a/roles/bodhi2/backend/files/new-updates-sync
+++ b/roles/bodhi2/backend/files/new-updates-sync
@@ -14,6 +14,7 @@ logger = logging.getLogger('updates-sync')
 
 
 SOURCE = '/mnt/koji/compose/updates/'
+RAWHIDESOURCE = '/mnt/koji/compose/rawhide/'
 FEDORADEST = '/pub/fedora/linux/updates/'
 FEDORAMODDEST = '/pub/fedora/linux/modular/updates/'
 FEDORAALTDEST = '/pub/fedora-secondary/updates/'
@@ -24,7 +25,7 @@ RELEASES = {'f30': {'topic': 'fedora',
                     'version': '30',
                     'modules': ['fedora', 'fedora-secondary'],
                     'repos': {'rawhide': {
-                        'from': 'f30',
+                        'from': 'latest-Fedora-Rawhide',
                         'ostrees': [{'ref': 'fedora/rawhide/%(arch)s/atomic-host',
                                      'dest': ATOMICDEST,
                                      'arches': ['x86_64', 'ppc64le', 'aarch64']},
@@ -291,9 +292,14 @@ def to_human(num_bytes):
 
 
 def sync_single_repo_arch(release, repo, arch, dest_path):
-    source_path = os.path.join(SOURCE,
-                               RELEASES[release]['repos'][repo]['from'],
-                               'compose', 'Everything', arch)
+    if repo == 'rawhide':
+        source_path = os.path.join(RAWHIDESOURCE,
+                                   RELEASES[release]['repos'][repo]['from'],
+                                   'compose', 'Everything', arch)
+    else:
+        source_path = os.path.join(SOURCE,
+                                   RELEASES[release]['repos'][repo]['from'],
+                                   'compose', 'Everything', arch)
 
     maindir = 'tree' if arch == 'source' else 'os'
 
@@ -356,8 +362,12 @@ def sync_single_repo(release, repo):
 
 
 def determine_last_link(release, repo):
-    source_path = os.path.join(SOURCE,
-                               RELEASES[release]['repos'][repo]['from'])
+    if repo == 'rawhide':
+        source_path = os.path.join(RAWHIDESOURCE,
+                                   RELEASES[release]['repos'][repo]['from'])
+    else:
+        source_path = os.path.join(SOURCE,
+                                   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


On Mon, Aug 27, 2018 at 4:02 PM Dusty Mabe <dusty@xxxxxxxxxxxxx> wrote:
mostly looks good a few nits inline

On 08/27/2018 03:57 PM, Mohan Boddu wrote:
> diff --git a/roles/bodhi2/backend/files/new-updates-sync b/roles/bodhi2/backend/files/new-updates-sync
> index 9ddc591..4537f0b 100755
> --- a/roles/bodhi2/backend/files/new-updates-sync
> +++ b/roles/bodhi2/backend/files/new-updates-sync
> @@ -14,6 +14,7 @@ logger = logging.getLogger('updates-sync')
>  
>  
>  SOURCE = '/mnt/koji/compose/updates/'
> +RAWHIDESOURCE = '/mnt/koji/compose/rawhide/'
>  FEDORADEST = '/pub/fedora/linux/updates/'
>  FEDORAMODDEST = '/pub/fedora/linux/modular/updates/'
>  FEDORAALTDEST = '/pub/fedora-secondary/updates/'
> @@ -24,7 +25,7 @@ RELEASES = {'f30': {'topic': 'fedora',
>                      'version': '30',
>                      'modules': ['fedora', 'fedora-secondary'],
>                      'repos': {'rawhide': {
> -                        'from': 'f30',
> +                        'from': 'latest-Fedora-Rawhide',
>                          'ostrees': [{'ref': 'fedora/rawhide/%(arch)s/atomic-host',
>                                       'dest': ATOMICDEST,
>                                       'arches': ['x86_64', 'ppc64le', 'aarch64']},
> @@ -291,6 +292,8 @@ def to_human(num_bytes):
>  
>  
>  def sync_single_repo_arch(release, repo, arch, dest_path):
> +    if repo == 'rawhide':
> +        SOURCE = RAWHIDESOURCE

can we make a local variable for this rather than re-assigning the value of
the global variable?

>      source_path = os.path.join(SOURCE,
>                                 RELEASES[release]['repos'][repo]['from'],
>                                 'compose', 'Everything', arch)
> @@ -356,6 +359,8 @@ def sync_single_repo(release, repo):
>  
>  
>  def determine_last_link(release, repo):
> +    if repo == 'rawhide':
> +        SOURCE = RAWHIDESOURCE

same comment as above

>      source_path = os.path.join(SOURCE,
>                                 RELEASES[release]['repos'][repo]['from'])
>      target = os.readlink(source_path)
>
> I guess this should fix the traceback:
> Traceback (most recent call last):
>   File "/usr/local/bin/new-updates-sync", line 443, in <module>
>     main()
>   File "/usr/local/bin/new-updates-sync", line 434, in main
>     if sync_single_release(release):
>   File "/usr/local/bin/new-updates-sync", line 371, in sync_single_release
>     target = determine_last_link(release, repo)
>   File "/usr/local/bin/new-updates-sync", line 361, in determine_last_link
>     target = os.readlink(source_path)
> OSError: [Errno 2] No such file or directory: '/mnt/koji/compose/updates/f30'
>
> I dont like using 'latest-Fedora-Rawhide' but unless we create another symlink
> this is the only option.

latest-Fedora-Rawhide works for me.
_______________________________________________
infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx

[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux