Merge lp:~therve/cloud-init/fix-landscape-config into lp:~cloud-init-dev/cloud-init/trunk

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

Description of the change

The branch adds the RUN=1 bit to the default file, so that the client starts properly once configured.

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

Thomas,
  Doesn't this cause us to write /etc/default/landscape-client unless there is invalid provided in user-data ?

  If I understand the current code correctly, we basically no-op if there is no 'landscape' section in cloud-config. (it is a long-winded no-op, but the end result is nothing changed). However, with your change here, we'd be modifying /etc/default/landscape-client always, without concern of its original content.

646. By Thomas Herve

Check if the config was specified

Revision history for this message
Thomas Herve (therve) wrote :

You're right, I missed that part. I added one conditional to check the config.

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-06-22 15:50:19 +0000
3+++ cloudinit/config/cc_landscape.py 2012-09-05 16:58:18 +0000
4@@ -31,6 +31,7 @@
5 frequency = PER_INSTANCE
6
7 LSC_CLIENT_CFG_FILE = "/etc/landscape/client.conf"
8+LS_DEFAULT_FILE = "/etc/default/landscape-client"
9
10 distros = ['ubuntu']
11
12@@ -78,6 +79,9 @@
13 util.write_file(lsc_client_fn, contents.getvalue())
14 log.debug("Wrote landscape config file to %s", lsc_client_fn)
15
16+ if ls_cloudcfg:
17+ util.write_file(LS_DEFAULT_FILE, "RUN=1\n")
18+
19
20 def merge_together(objs):
21 """