Ubuntu Pastebin

Paste from smoser at Mon, 27 Jun 2016 20:18:39 +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
------------------------------------------------------------
revno: 1246
fixes bug: https://launchpad.net/bugs/1596690
committer: Scott Moser <smoser@ubuntu.com>
branch nick: trunk.1596690
timestamp: Mon 2016-06-27 16:18:25 -0400
message:
  fix restoring from a datasource that did not have dsmode
  
  On upgrade and reboot, if datasource restored from obj.pkl did not have
  a dsmode attribute, then 'init --local' would fail due to stack trace.
diff:
=== modified file 'cloudinit/sources/__init__.py'
--- cloudinit/sources/__init__.py	2016-05-26 19:50:59 +0000
+++ cloudinit/sources/__init__.py	2016-06-27 20:18:25 +0000
@@ -55,6 +55,8 @@
 @six.add_metaclass(abc.ABCMeta)
 class DataSource(object):
 
+    dsmode = DSMODE_NETWORK
+
     def __init__(self, sys_cfg, distro, paths, ud_proc=None):
         self.sys_cfg = sys_cfg
         self.distro = distro
@@ -64,7 +66,6 @@
         self.userdata_raw = None
         self.vendordata = None
         self.vendordata_raw = None
-        self.dsmode = DSMODE_NETWORK
 
         # find the datasource config name.
         # remove 'DataSource' from classname on front, and remove 'Net' on end.
Download as text