Ubuntu Pastebin

Paste from smoser at Fri, 24 Mar 2017 17:56:00 +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/DataSourceOpenNebula.py b/cloudinit/sources/DataSourceOpenNebula.py
index 10c6d3db..cd75e6ea 100644
--- a/cloudinit/sources/DataSourceOpenNebula.py
+++ b/cloudinit/sources/DataSourceOpenNebula.py
@@ -282,23 +282,23 @@ def parse_shell_config(content, keylist=None, bash=None, asuser=None,
     excluded = ("RANDOM", "LINENO", "SECONDS", "_", "__v")
     preset = {}
     ret = {}
-    target = {}
+    target = None
     output = output[0:-1]  # remove trailing null
 
     # go through output.  First _start_ is for 'preset', second for 'target'.
-    # Add to target only things were changed and not in volitile
+    # Add to ret only things were changed and not in excluded.
     for line in output.split("\x00"):
         try:
             (key, val) = line.split("=", 1)
             if target is preset:
-                target[key] = val
+                preset[key] = val
             elif (key not in excluded and
                   (key in keylist_in or preset.get(key) != val)):
                 ret[key] = val
         except ValueError:
             if line != "_start_":
                 raise
-            if target == {}:
+            if target is None:
                 target = preset
             elif target is preset:
                 target = ret
diff --git a/tox.ini b/tox.ini
index d65ec48f..4f2240aa 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = py27, py3, flake8, xenial
+envlist = py27, py3, flake8, xenial, pylint
 recreate = True
 
 [testenv]
@@ -18,7 +18,7 @@ setenv =
     LC_ALL = en_US.utf-8
 
 [testenv:pylint]
-deps = pylint
+deps = pylint==1.6.5
 commands = {envpython} -m pylint {posargs:cloudinit}
 
 [testenv:py3]
Download as text