manage_sru script can't handle un-recognized kernel

Bug #1642909 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Hardware Certification Tools
Fix Released
High
Po-Hsu Lin

Bug Description

There is a list in the script:
RELEASES = {'2.6': 'lucid',
            '3.2': 'precise',
            '3.13': 'trusty',
            '3.16': 'utopic',
            '3.19': 'vivid',
            '3.13lts': 'precise',
            '3.16lts': 'trusty',
            '3.19lts': 'trusty',
            '4.2lts': 'trusty',
            '4.4lts': 'trusty',
            '4.2': 'wily',
            '4.4': 'xenial'}

If the kernel number is not in this dictionary (yakkety for this case), the script will crash like:

Bug #1640928 in Kernel SRU Workflow: "linux-snapdragon: 4.4.0-1036.40 -proposed tracker": https://bugs.launchpad.net/kernel-sru-workflow/+bug/1640928
Bug #1641180 in Kernel SRU Workflow: "linux-raspi2: 4.8.0-1019.22 -proposed tracker": https://bugs.launchpad.net/kernel-sru-workflow/+bug/1641180
kernel file: /home/certification/sru-kernels/snapdragon-xenial_kernel updated
Traceback (most recent call last):
  File "/home/certification/hwcert-tools/sru_tools/manage_sru", line 277, in <module>
    sys.exit(main())
  File "/home/certification/hwcert-tools/sru_tools/manage_sru", line 274, in main
    args.func(**params)
  File "/home/certification/hwcert-tools/sru_tools/manage_sru", line 72, in notify_kernels
    codename = kernel_name.split('-')[1] + '-' + RELEASES.get(codename)
TypeError: coercing to Unicode: need string or buffer, NoneType found

Related branches

Po-Hsu Lin (cypressyew)
Changed in hwcert-tools:
status: New → In Progress
assignee: nobody → Po-Hsu Lin (cypressyew)
importance: Undecided → High
Po-Hsu Lin (cypressyew)
Changed in hwcert-tools:
status: In Progress → Fix Released
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.