canonical-certification server and other -cli commands crash due to use of job.name rather than job.id

Bug #1305288 reported by Daniel Manrique
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Next Generation Checkbox (CLI)
Fix Released
Critical
Daniel Manrique

Bug Description

- Install a Trusty server system
- Add the ppa:checkbox-dev/ppa
- install checkbox-ng plainbox-provider-certification-server
- run canonical-certification-server
- select the server-cert whitelist

Expected result:
- List of tests to run

Actual result:

  File "/usr/lib/python3/dist-packages/checkbox_ng/commands/cli.py", line 146, in render
    line = prefix + self.depth * ' ' + ' ' + title
TypeError: Can't convert 'NoneType' object to str implicitly

This is because cli.py still has job.name instead of job.id in that line. Switching that to job.id makes it work (though it shows namespaced job names). It can also be job.partial_id, but job.name is just bad :)

$ grep -r 'job\.name' *
checkbox-ng/checkbox_ng/commands/cli.py: title = job.name # THIS IS THE ONE
plainbox/plainbox/impl/job.py: if deprecated and job.name is not None:
plainbox/plainbox/impl/test_job.py: self.assertIn('B', [job.name for job in node.jobs])
plainbox/plainbox/impl/test_job.py: self.assertIn('B', [job.name for job in node.jobs])

Related branches

Revision history for this message
Daniel Manrique (roadmr) wrote :

Critical because cli commands outright don't work if this bug is present.

Changed in checkbox-ng:
importance: Undecided → Critical
status: New → In Progress
assignee: nobody → Daniel Manrique (roadmr)
Zygmunt Krynicki (zyga)
tags: added: sru-candidate
Changed in checkbox-ng:
status: In Progress → Fix Committed
milestone: none → 0.3.2
Daniel Manrique (roadmr)
Changed in checkbox-ng:
status: Fix Committed → Fix Released
Changed in checkbox-ng:
milestone: 0.3.2 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.