]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: [Debian] git-ubuntu-log -- handle invalid or private bugs
authorAndy Whitcroft <apw@canonical.com>
Mon, 22 Feb 2016 19:47:02 +0000 (19:47 +0000)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
Signed-off-by: Andy Whitcroft <apw@canonical.com>
debian/scripts/misc/git-ubuntu-log

index 906c6069c3f6a0441951d8989533b9deada33b67..762fa28161913598f0673e2c3a87bcd527d87ff5 100755 (executable)
@@ -64,18 +64,22 @@ for bug in bugs:
     else:
         bug_info = None
 
-        #urllib.request.urlcleanup()
-        request = urllib.request.Request('https://api.launchpad.net/devel/bugs/' + bug)
-        request.add_header('Cache-Control', 'max-age=0')
-        with urllib.request.urlopen(request) as response:
-            data = response.read()
-            bug_info = json.loads(data.decode('utf-8'))
-        
-        title = bug_info['title']
-        if 'description' in bug_info:
-            for line in bug_info['description'].split('\n'):
-                if line.startswith('Kernel-Description:'):
-                    title = line.split(' ', 1)[1]
+        try:
+            #urllib.request.urlcleanup()
+            request = urllib.request.Request('https://api.launchpad.net/devel/bugs/' + bug)
+            request.add_header('Cache-Control', 'max-age=0')
+            with urllib.request.urlopen(request) as response:
+                data = response.read()
+                bug_info = json.loads(data.decode('utf-8'))
+            
+            title = bug_info['title']
+            if 'description' in bug_info:
+                for line in bug_info['description'].split('\n'):
+                    if line.startswith('Kernel-Description:'):
+                        title = line.split(' ', 1)[1]
+
+        except urllib.error.HTTPError:
+            title = 'INVALID or PRIVATE BUG'
 
         title += ' (LP: #' + bug + ')'