diff mbox

[kteam-tools,2/2] ktl/ubuntu.py: fix series lookup for -azure kernels

Message ID 20170518151324.8532-3-kleber.souza@canonical.com
State New
Headers show

Commit Message

Kleber Sacilotto de Souza May 18, 2017, 3:13 p.m. UTC
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
---
 ktl/ubuntu.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox

Patch

diff --git a/ktl/ubuntu.py b/ktl/ubuntu.py
index 22276884..36845346 100644
--- a/ktl/ubuntu.py
+++ b/ktl/ubuntu.py
@@ -220,6 +220,18 @@  class Ubuntu:
             for entry in self.db.values():
                 if version.startswith(entry['kernel']):
                     retval = entry['name']
+                    series_version = entry['series_version']
+
+            # linux-azure is a backport that doesn't contain the 'upstream'
+            # series number on the package name, so we need to look for it
+            # first and then look for the target series.
+            if package.startswith('linux-azure'):
+                for entry in self.db.values():
+                    if 'backport-packages' in entry.keys() and \
+                            package in entry['backport-packages'] and \
+                            entry['backport-packages'][package][0] == 'linux' and \
+                            entry['backport-packages'][package][1] == series_version:
+                        retval = entry['name']
 
         return retval