[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#865577: cloud-init FTBFS: recipe for target 'pep8' failed



Hey.

As there has not been yet a new release of the upstream package (current
one is 0.7.9) to which we could upgrade, I decided to create a patch
specifically for Debian. See it attached. The patch is pretty much the
same as Joshua Powers' upstream one. The only difference is the usage of
httplib instead of hclient.

Thanks,
Joonas Kylmälä
>From 8afb8941e696b74ca03a7c80e15eed320e1b8e72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@iki.fi>
Date: Sun, 25 Jun 2017 07:42:13 +0200
Subject: [PATCH] Fix Python code style errors (Closes #865577)

This commit is based on Joshua Powers' upstream commit
with hash 5f14a0b1ca3079e4ab43d615840866a4b7d8df6a
(code-style: make master pass pycodestyle (2.3.1) cleanly).
---
 tools/make-mime.py | 2 +-
 tools/mock-meta.py | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/make-mime.py b/tools/make-mime.py
index 12727126..f6a72044 100755
--- a/tools/make-mime.py
+++ b/tools/make-mime.py
@@ -22,7 +22,7 @@ def file_content_type(text):
     try:
         filename, content_type = text.split(":", 1)
         return (open(filename, 'r'), filename, content_type.strip())
-    except:
+    except ValueError:
         raise argparse.ArgumentError("Invalid value for %r" % (text))
 
 
diff --git a/tools/mock-meta.py b/tools/mock-meta.py
index d74f9e31..2165d623 100755
--- a/tools/mock-meta.py
+++ b/tools/mock-meta.py
@@ -249,7 +249,10 @@ class MetaDataHandler(object):
                 try:
                     key_id = int(mybe_key)
                     key_name = key_ids[key_id]
-                except:
+                except ValueError:
+                    raise WebException(httplib.BAD_REQUEST,
+                                       "%s: not an integer" % mybe_key)
+                except KeyError:
                     raise WebException(httplib.BAD_REQUEST,
                                        "Unknown key id %r" % mybe_key)
                 # Extract the possible sub-params
-- 
2.11.0


Reply to: