Merge lp:~agx/cloud-init/nocloud into lp:~cloud-init-dev/cloud-init/trunk

Proposed by Guido Günther
Status: Merged
Merge reported by: Scott Moser
Merged at revision: not available
Proposed branch: lp:~agx/cloud-init/nocloud
Merge into: lp:~cloud-init-dev/cloud-init/trunk
Diff against target: 13 lines (+3/-0)
1 file modified
cloudinit/sources/DataSourceNoCloud.py (+3/-0)
To merge this branch: bzr merge lp:~agx/cloud-init/nocloud
Reviewer Review Type Date Requested Status
cloud-init Commiters Pending
Review via email: mp+276426@code.launchpad.net

Description of the change

nocloud: Make sure ds_cfg is not None

otherwise this barfs when accessing it for the first time in get_data().
This is modelled like the DataSourceOpenStack.

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

Hi,
I've just committed revision 1194 to trunk that should fix this for you.
Now the base DataSource class sets ds_cfg to a {} rather than None if it was set. so you should only ever get it as a dictionary.

Revision history for this message
Guido Günther (agx) wrote :

On Mon, Apr 04, 2016 at 04:41:11PM -0000, Scott Moser wrote:
> The proposal to merge lp:~agx/cloud-init/nocloud into lp:cloud-init has been updated.
>
> Status: Needs review => Merged
>
> For more details, see:
> https://code.launchpad.net/~agx/cloud-init/nocloud/+merge/276426

Thanks a lot!
 -- Guido

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cloudinit/sources/DataSourceNoCloud.py'
2--- cloudinit/sources/DataSourceNoCloud.py 2015-09-08 18:26:30 +0000
3+++ cloudinit/sources/DataSourceNoCloud.py 2015-11-02 17:12:15 +0000
4@@ -38,6 +38,9 @@
5 self.cmdline_id = "ds=nocloud"
6 self.seed_dir = os.path.join(paths.seed_dir, 'nocloud')
7 self.supported_seed_starts = ("/", "file://")
8+ if not self.ds_cfg:
9+ self.ds_cfg = {}
10+
11
12 def __str__(self):
13 root = sources.DataSource.__str__(self)