diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-06-27 16:18:25 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-06-27 16:18:25 -0400 |
commit | 65f611905dbf8690aeda355eafb4c431be96126e (patch) | |
tree | fd83da919d5937003b44050a45cf3c583a088e10 | |
parent | c1b11d5e5432dee0042e9e568bd63cfe05f8a9b2 (diff) | |
download | cloud-init-65f611905dbf8690aeda355eafb4c431be96126e.tar.gz |
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.
-rw-r--r-- | cloudinit/sources/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cloudinit/sources/__init__.py b/cloudinit/sources/__init__.py index 2a6b8d90..87b8e524 100644 --- a/cloudinit/sources/__init__.py +++ b/cloudinit/sources/__init__.py @@ -55,6 +55,8 @@ class DataSourceNotFoundException(Exception): @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 @@ class DataSource(object): 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. |