Ticket #625 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

bodhi -L dies with out-of-range exception after branching f16

Reported by: ppisar Owned by: lmacken
Priority: major Milestone: Fixed, but not yet deployed
Component: bodhi-client Version:
Keywords: Cc:
Blocked By: Blocking:

Description

After branching f16, bodhi -L stopped working:

$ bodhi -L perl-threads-tbb
Traceback (most recent call last):
  File "/usr/bin/bodhi", line 519, in <module>
    main()
  File "/usr/bin/bodhi", line 374, in main
    data.sort(cmp=lambda x, y: cmp(x[0].split('-')[1],
  File "/usr/bin/bodhi", line 375, in <lambda>
    y[0].split('-')[1]))
IndexError: list index out of range

bodhi-client-0.8.0-1.fc15.noarch

Change History

comment:1 Changed 3 years ago by tibbs

The problem is that bodhi client does not like to see the tags named without the "dist-" prefix, so the tag "f16" confuses it.

Naive patch (hopefully not too mangled by trac):

--- bodhi.orig 2011-07-29 17:54:15.063616729 -0500 +++ bodhi 2011-07-29 17:59:49.534280802 -0500 @@ -371,8 +371,8 @@

log.info(datatg_flash?)

del(datatg_flash?)

data = data.items()

  • data.sort(cmp=lambda x, y: cmp(x[0].split('-')[1],
  • y[0].split('-')[1]))

+ data.sort(cmp=lambda x, y: cmp(x[0].replace('dist-',).split('-')[0], + y[0].replace('dist-',).split('-')[0]))

for dist, build in data:

print('%26s %s' % (dist, build))

Probably want to do something less hackish, though; I'm not really an ace python programmer.

comment:2 Changed 3 years ago by tibbs

Umm, that sucked. Should have used preview.

--- bodhi.orig  2011-07-29 17:54:15.063616729 -0500
+++ bodhi       2011-07-29 17:59:49.534280802 -0500
@@ -371,8 +371,8 @@
                         log.info(data['tg_flash'])
                     del(data['tg_flash'])
                 data = data.items()
-                data.sort(cmp=lambda x, y: cmp(x[0].split('-')[1],
-                                               y[0].split('-')[1]))
+                data.sort(cmp=lambda x, y: cmp(x[0].replace('dist-','').split('-')[0],
+                                               y[0].replace('dist-','').split('-')[0]))
                 for dist, build in data:
                     print('%26s  %s' % (dist, build))

comment:3 Changed 3 years ago by ppisar

This patch seems working (correct source file is bodhi/tools/client.py).

However it's ugly. Provided server allows any arbitrary dist-tag names, client should not parse them. If ordering is needed, server should provide ordinal numbers as separate attribute.

comment:4 Changed 2 years ago by lmacken

  • Owner set to lmacken
  • Status changed from new to assigned
  • Milestone set to Fixed, but not yet deployed

comment:5 Changed 2 years ago by lmacken

  • Status changed from assigned to closed
  • Resolution set to fixed

This issue should be resolved with bodhi v0.8.3, which is currently deployed to production.

Note: See TracTickets for help on using tickets.