Ubuntu Pastebin

Paste from ubuntu at Fri, 30 Sep 2016 00:34:54 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
diff --git a/cloudinit/sources/helpers/azure.py b/cloudinit/sources/helpers/azure.py
index 689ed4c..4318638 100644
--- a/cloudinit/sources/helpers/azure.py
+++ b/cloudinit/sources/helpers/azure.py
@@ -232,7 +232,7 @@ class WALinuxAgentShim(object):
     def _get_value_from_leases_file(fallback_lease_file):
         leases = []
         content = util.load_file(fallback_lease_file)
-        LOG.debug("content is {}".format(content))
+        LOG.debug("content is: %s", content)
         for line in content.splitlines():
             if 'unknown-245' in line:
                 # Example line from Ubuntu
diff --git a/cloudinit/util.py b/cloudinit/util.py
index eb3e589..6b388c9 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -1821,7 +1821,7 @@ def subp(args, data=None, rcs=None, env=None, capture=True, shell=False,
             def ldecode(data, m='utf-8'):
                 if not isinstance(data, bytes):
                     return data
-                return data.decode(m, errors=decode)
+                return data.decode(m, decode)
 
             out = ldecode(out)
             err = ldecode(err)
diff --git a/tests/unittests/test_handler/test_handler_apt_conf_v1.py b/tests/unittests/test_handler/test_handler_apt_conf_v1.py
index 45714ef..e00610a 100644
--- a/tests/unittests/test_handler/test_handler_apt_conf_v1.py
+++ b/tests/unittests/test_handler/test_handler_apt_conf_v1.py
@@ -118,7 +118,7 @@ class TestConversion(TestCase):
     def test_convert_with_apt_mirror(self):
         mirror = 'http://my.mirror/ubuntu'
         f = cc_apt_configure.convert_to_v3_apt_format({'apt_mirror': mirror})
-        self.assertIn(mirror, {m['uri'] for m in f['apt']['primary']})
+        self.assertIn(mirror, set([m['uri'] for m in f['apt']['primary']]))
 
     def test_no_old_content(self):
         mirror = 'http://my.mirror/ubuntu'
diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py
index fc6b9d4..881509a 100644
--- a/tests/unittests/test_util.py
+++ b/tests/unittests/test_util.py
@@ -553,7 +553,7 @@ class TestSubp(helpers.TestCase):
     def test_subp_decode_invalid_utf8_replaces(self):
         (out, _err) = util.subp(self.stdin2out, capture=True,
                                 data=self.utf8_invalid)
-        expected = self.utf8_invalid.decode('utf-8', errors='replace')
+        expected = self.utf8_invalid.decode('utf-8', 'replace')
         self.assertEqual(out, expected)
 
     def test_subp_decode_strict_raises(self):
Download as text