summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hervé <thomas@canonical.com>2012-10-15 11:06:52 -0400
committerScott Moser <smoser@ubuntu.com>2012-10-15 11:06:52 -0400
commitbdaa57bc5b8a75b0891673a7bb0a60c5b02beb7c (patch)
treec1cdd22ae8015490a80a6791f61bb503c677817a
parent4a3eab9f5a49f8ebdf30b8378fa58c342b3d9c8a (diff)
parent7d7cb0c7126ad4f67099f741dac67aceff66d002 (diff)
downloadvyos-cloud-init-bdaa57bc5b8a75b0891673a7bb0a60c5b02beb7c.tar.gz
vyos-cloud-init-bdaa57bc5b8a75b0891673a7bb0a60c5b02beb7c.zip
cc_landscape: do nothing if config not give. install landscape-client.
LP: #1066115
-rw-r--r--ChangeLog2
-rw-r--r--cloudinit/config/cc_landscape.py7
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 672482ba..4287d58f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
0.7.1:
- sysvinit: fix missing dependency in cloud-init job for RHEL 5.6
- config-drive: map hostname to local-hostname (LP: #1061964)
+ - landscape: install landscape-client package if not installed.
+ only take action if cloud-config is present (LP: #1066115)
0.7.0:
- add a 'exception_cb' argument to 'wait_for_url'. If provided, this
method will be called back with the exception received and the message.
diff --git a/cloudinit/config/cc_landscape.py b/cloudinit/config/cc_landscape.py
index 7cfb8296..331559f4 100644
--- a/cloudinit/config/cc_landscape.py
+++ b/cloudinit/config/cc_landscape.py
@@ -59,6 +59,10 @@ def handle(_name, cfg, cloud, log, _args):
raise RuntimeError(("'landscape' key existed in config,"
" but not a dictionary type,"
" is a %s instead"), util.obj_name(ls_cloudcfg))
+ if not ls_cloudcfg:
+ return
+
+ cloud.distro.install_packages(["landscape-client"])
merge_data = [
LSC_BUILTIN_CFG,
@@ -79,8 +83,7 @@ def handle(_name, cfg, cloud, log, _args):
util.write_file(lsc_client_fn, contents.getvalue())
log.debug("Wrote landscape config file to %s", lsc_client_fn)
- if ls_cloudcfg:
- util.write_file(LS_DEFAULT_FILE, "RUN=1\n")
+ util.write_file(LS_DEFAULT_FILE, "RUN=1\n")
def merge_together(objs):