Merge lp:~therve/cloud-init/landscape-conf-permissions into lp:~cloud-init-dev/cloud-init/trunk

Proposed by Thomas Herve
Status: Merged
Merged at revision: 687
Proposed branch: lp:~therve/cloud-init/landscape-conf-permissions
Merge into: lp:~cloud-init-dev/cloud-init/trunk
Diff against target: 24 lines (+5/-2)
1 file modified
cloudinit/config/cc_landscape.py (+5/-2)
To merge this branch: bzr merge lp:~therve/cloud-init/landscape-conf-permissions
Reviewer Review Type Date Requested Status
cloud-init Commiters Pending
Review via email: mp+129618@code.launchpad.net

Description of the change

A fairly simple fix. I decided to skip all the work when there is no config section, and then enforce the package installation, which will create the config file with the proper permissions.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cloudinit/config/cc_landscape.py'
2--- cloudinit/config/cc_landscape.py 2012-09-05 16:55:58 +0000
3+++ cloudinit/config/cc_landscape.py 2012-10-15 08:27:27 +0000
4@@ -59,6 +59,10 @@
5 raise RuntimeError(("'landscape' key existed in config,"
6 " but not a dictionary type,"
7 " is a %s instead"), util.obj_name(ls_cloudcfg))
8+ if not ls_cloudcfg:
9+ return
10+
11+ cloud.distro.install_packages(["landscape-client"])
12
13 merge_data = [
14 LSC_BUILTIN_CFG,
15@@ -79,8 +83,7 @@
16 util.write_file(lsc_client_fn, contents.getvalue())
17 log.debug("Wrote landscape config file to %s", lsc_client_fn)
18
19- if ls_cloudcfg:
20- util.write_file(LS_DEFAULT_FILE, "RUN=1\n")
21+ util.write_file(LS_DEFAULT_FILE, "RUN=1\n")
22
23
24 def merge_together(objs):