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
=== modified file 'cloudinit/config/cc_landscape.py'
--- cloudinit/config/cc_landscape.py 2012-09-05 16:55:58 +0000
+++ cloudinit/config/cc_landscape.py 2012-10-15 08:27:27 +0000
@@ -59,6 +59,10 @@
59 raise RuntimeError(("'landscape' key existed in config,"59 raise RuntimeError(("'landscape' key existed in config,"
60 " but not a dictionary type,"60 " but not a dictionary type,"
61 " is a %s instead"), util.obj_name(ls_cloudcfg))61 " is a %s instead"), util.obj_name(ls_cloudcfg))
62 if not ls_cloudcfg:
63 return
64
65 cloud.distro.install_packages(["landscape-client"])
6266
63 merge_data = [67 merge_data = [
64 LSC_BUILTIN_CFG,68 LSC_BUILTIN_CFG,
@@ -79,8 +83,7 @@
79 util.write_file(lsc_client_fn, contents.getvalue())83 util.write_file(lsc_client_fn, contents.getvalue())
80 log.debug("Wrote landscape config file to %s", lsc_client_fn)84 log.debug("Wrote landscape config file to %s", lsc_client_fn)
8185
82 if ls_cloudcfg:86 util.write_file(LS_DEFAULT_FILE, "RUN=1\n")
83 util.write_file(LS_DEFAULT_FILE, "RUN=1\n")
8487
8588
86def merge_together(objs):89def merge_together(objs):