#2212 bodhi: Remove usage of version_int from pungi template
Merged 2 months ago by zlopez. Opened 2 months ago by carlwgeorge.
fedora-infra/ carlwgeorge/ansible epel10_bodhi_pungi  into  main

@@ -5,7 +5,7 @@ 

  

  # PRODUCT INFO

  skip_phases = ["buildinstall", "extra_files"]

- release_version = '[[ release.version_int ]]'

+ release_version = '[[ release.version ]]'

  release_type = 'updates[% if request.name == 'testing' %]-testing[% endif %]'

  old_composes_per_release_type = True

  release_name = '[[ release.id_prefix.title() ]]'
@@ -21,23 +21,23 @@ 

  }

  variants_file='variants.xml'

  sigkeys = [

- [% if release.version_int == 38 %]

+ [% if release.version == '38' %]

      'eb10b464',

- [% elif release.version_int == 39 %]

+ [% elif release.version == '39' %]

      '18B8e74c',

- [% elif release.version_int == 40 %]

+ [% elif release.version == '40' %]

      'a15B79cc',

- [% elif release.version_int == 41 %]

+ [% elif release.version == '41' %]

      'e99d6ad1',

- [% elif release.version_int == 42 %]

+ [% elif release.version == '42' %]

      '105ef944',

- [% elif release.version_int == 6 %]

+ [% elif release.version == '6' %]

      '0608b895',

- [% elif release.version_int == 7 %]

+ [% elif release.version == '7' %]

      '352C64E5',

- [% elif release.version_int == 8 %]

+ [% elif release.version == '8' %]

      '2f86d6a1'

- [% elif release.version_int == 9 %]

+ [% elif release.version == '9' %]

      '3228467c',

  [% elif release.version.startswith("10.") %]

      'e37ed158',
@@ -51,7 +51,7 @@ 

  # RUNROOT settings

  runroot = True

  runroot_channel = 'compose'

- runroot_tag = 'f[[ release.version_int ]]-build'

+ runroot_tag = 'f[[ release.version ]]-build'

  

  # PKGSET

  pkgset_koji_tag = '[[ id ]]'
@@ -83,7 +83,7 @@ 

  

  createrepo_extra_args = [

  [% if cr_config.zchunk %]

-     '--zck', '--zck-dict-dir=/usr/share/fedora-repo-zdicts/f[[ release.version_int ]]',

+     '--zck', '--zck-dict-dir=/usr/share/fedora-repo-zdicts/f[[ release.version ]]',

  [% endif %]

  [% if cr_config.repodata_comp %]

  [% if cr_config.general_comp %]
@@ -131,13 +131,13 @@ 

  {% set repos = '[

                  [% if request.name == "testing" %]

                      [# In the case of testing, also inject the last stable updates #]

-                     "https://kojipkgs{env_suffix}.fedoraproject.org/compose/updates/f[[ release.version_int ]]-updates/compose/Everything/$basearch/os/",

+                     "https://kojipkgs{env_suffix}.fedoraproject.org/compose/updates/f[[ release.version ]]-updates/compose/Everything/$basearch/os/",

                  [% endif %]

-                 [% if release.version_int == 41 %]

+                 [% if release.version == '41' %]

                      [# For F41 the compose location is going to be under /compose/branched/ #]

-                     "https://kojipkgs{env_suffix}.fedoraproject.org/compose/branched/latest-Fedora-[[ release.version_int ]]/compose/Everything/$basearch/os/"

+                     "https://kojipkgs{env_suffix}.fedoraproject.org/compose/branched/latest-Fedora-[[ release.version ]]/compose/Everything/$basearch/os/"

                  [% else %]

-                     "https://kojipkgs{env_suffix}.fedoraproject.org/compose/[[ release.version_int ]]/latest-Fedora-[[ release.version_int ]]/compose/Everything/$basearch/os/"

+                     "https://kojipkgs{env_suffix}.fedoraproject.org/compose/[[ release.version ]]/latest-Fedora-[[ release.version ]]/compose/Everything/$basearch/os/"

                  [% endif %]

              ]'.format(env_suffix=env_suffix) %}

  
@@ -159,7 +159,7 @@ 

          "config_branch": "f[[ release.version ]]",

          "repo": {{ repos }},

          "ostree_repo": "/mnt/koji/compose/ostree/repo",

-         "ostree_ref": "fedora/[[ release.version_int ]]/${basearch}/[[ ostreeref ]]/silverblue",

+         "ostree_ref": "fedora/[[ release.version ]]/${basearch}/[[ ostreeref ]]/silverblue",

          "tag_ref": False,

          "arches": ["x86_64", "ppc64le", "aarch64" ],

          "failable": ["x86_64", "ppc64le", "aarch64" ]
@@ -173,7 +173,7 @@ 

          "config_branch": "f[[ release.version ]]",

          "repo": {{ repos }},

          "ostree_repo": "/mnt/koji/compose/ostree/repo",

-         "ostree_ref": "fedora/[[ release.version_int ]]/${basearch}/[[ ostreeref ]]/kinoite",

+         "ostree_ref": "fedora/[[ release.version ]]/${basearch}/[[ ostreeref ]]/kinoite",

          "tag_ref": False,

          "arches": ["x86_64", "ppc64le", "aarch64" ],

          "failable": ["x86_64", "ppc64le", "aarch64" ]
@@ -187,7 +187,7 @@ 

          "config_branch": "f[[ release.version ]]",

          "repo": {{ repos }},

          "ostree_repo": "/mnt/koji/compose/ostree/repo",

-         "ostree_ref": "fedora/[[ release.version_int ]]/${basearch}/[[ ostreeref ]]/sericea",

+         "ostree_ref": "fedora/[[ release.version ]]/${basearch}/[[ ostreeref ]]/sericea",

          "tag_ref": False,

          "arches": ["x86_64", "aarch64"],

          "failable": ["x86_64", "aarch64"]
@@ -201,7 +201,7 @@ 

          "config_branch": "f[[ release.version ]]",

          "repo": {{ repos }},

          "ostree_repo": "/mnt/koji/compose/ostree/repo",

-         "ostree_ref": "fedora/[[ release.version_int ]]/${basearch}/[[ ostreeref ]]/onyx",

+         "ostree_ref": "fedora/[[ release.version ]]/${basearch}/[[ ostreeref ]]/onyx",

          "tag_ref": False,

          "arches": ["x86_64"],

          "failable": ["x86_64"]

EPEL 10 has minor versions, and bodhi's Release.version_int property doesn't handle versions with a dot correctly (yet). Almost all of our usage is for constructing strings or for equality comparisons that can be strings, so we can just use Release.version instead. There is an instance of a numerical greater than or equal to comparison, but it is inside a condition for release.id_prefix == 'FEDORA', so it shouldn't get evaluated for EPEL updates.

Signed-off-by: Carl George carlwgeorge@gmail.com

rebased onto 2528d84

2 months ago

rebased onto 2528d84

2 months ago

Pull-Request has been merged by zlopez

2 months ago

Merged and tried to deploy by running:

ansible-playbook /srv/web/infra/ansible/playbooks/groups/bodhi-backend.yml -t bodhi/pungi

It fails with:

AnsibleError: template error while templating string: expected token 'end of statement block', got 'integer'.

It seems like a jinja2 templating error.

And here is the full traceback (hopefully that helps):

The full traceback is:                                                                                                                                                       
Traceback (most recent call last):                                                                                                                                           
  File "/usr/lib/python3.9/site-packages/ansible/template/__init__.py", line 966, in do_template                                                                             
    t = myenv.from_string(data)                                                                                                                                              
  File "/usr/lib/python3.9/site-packages/ansible/_vendor/jinja2/environment.py", line 1105, in from_string                                                                   
    return cls.from_code(self, self.compile(source), gs, None)                                                                                                               
  File "/usr/lib/python3.9/site-packages/ansible/_vendor/jinja2/environment.py", line 768, in compile                                                                        
    self.handle_exception(source=source_hint)                                                                                                                                
  File "/usr/lib/python3.9/site-packages/ansible/_vendor/jinja2/environment.py", line 936, in handle_exception                                                               
    raise rewrite_traceback_stack(source=source)                                                                                                                             
  File "<unknown>", line 136, in template                                             
jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'integer'  

Thanks for the traceback, I see the problem (double vs single quote) and will send a followup PR shortly.

Metadata