summaryrefslogtreecommitdiff
path: root/cloudinit/__init__.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2011-01-31 16:40:43 -0500
committerScott Moser <smoser@ubuntu.com>2011-01-31 16:40:43 -0500
commit85444c68c8728d4324b71218d15d4f04ecdb4fbd (patch)
tree4759569605606ca1776eb2688d3d58e28752fa66 /cloudinit/__init__.py
parent9e520d45a60a91750f9ad77da0be7dc58e57f4d8 (diff)
downloadvyos-cloud-init-85444c68c8728d4324b71218d15d4f04ecdb4fbd.tar.gz
vyos-cloud-init-85444c68c8728d4324b71218d15d4f04ecdb4fbd.zip
replace DataSource's self.log
After adding the 'log' element to the DataSource class, pickling would fail with TypeError: can't pickle file objects Instead of having the object with a log reference, use one from 'DataSource.log' and have that set by cloudinit
Diffstat (limited to 'cloudinit/__init__.py')
-rw-r--r--cloudinit/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py
index 7406e19f..47e4e10a 100644
--- a/cloudinit/__init__.py
+++ b/cloudinit/__init__.py
@@ -102,6 +102,7 @@ def logging_set_from_cfg(cfg):
import DataSource
+DataSource.setlog(log)
import UserDataHandler
class CloudInit:
@@ -190,7 +191,7 @@ class CloudInit:
for cls in dslist:
ds = cls.__name__
try:
- s = cls(log)
+ s = cls()
if s.get_data():
self.datasource = s
self.datasource_name = ds