summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_landscape.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-11-07 20:53:34 -0800
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-11-07 20:53:34 -0800
commitdbeb73f174ccc3b992a8488b7a72cf35c685f139 (patch)
treeeb857beba4c6b71cd1ab8ba4b947ab54907349e5 /cloudinit/config/cc_landscape.py
parent04f52eb593e4f5114626c74fd8f3c5a9a8d440bd (diff)
parent1e6fc277a1c8d695c37741cc31f5ddab3d5b5600 (diff)
downloadvyos-cloud-init-dbeb73f174ccc3b992a8488b7a72cf35c685f139.tar.gz
vyos-cloud-init-dbeb73f174ccc3b992a8488b7a72cf35c685f139.zip
1. Rebased with trunk
2. Added example cloud-config 3. Added functioning test for yum config
Diffstat (limited to 'cloudinit/config/cc_landscape.py')
-rw-r--r--cloudinit/config/cc_landscape.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/cloudinit/config/cc_landscape.py b/cloudinit/config/cc_landscape.py
index 331559f4..02610dd0 100644
--- a/cloudinit/config/cc_landscape.py
+++ b/cloudinit/config/cc_landscape.py
@@ -66,24 +66,19 @@ def handle(_name, cfg, cloud, log, _args):
merge_data = [
LSC_BUILTIN_CFG,
- cloud.paths.join(True, LSC_CLIENT_CFG_FILE),
+ LSC_CLIENT_CFG_FILE,
ls_cloudcfg,
]
merged = merge_together(merge_data)
-
- lsc_client_fn = cloud.paths.join(False, LSC_CLIENT_CFG_FILE)
- lsc_dir = cloud.paths.join(False, os.path.dirname(lsc_client_fn))
- if not os.path.isdir(lsc_dir):
- util.ensure_dir(lsc_dir)
-
contents = StringIO()
merged.write(contents)
- contents.flush()
- util.write_file(lsc_client_fn, contents.getvalue())
- log.debug("Wrote landscape config file to %s", lsc_client_fn)
+ util.ensure_dir(os.path.dirname(LSC_CLIENT_CFG_FILE))
+ util.write_file(LSC_CLIENT_CFG_FILE, contents.getvalue())
+ log.debug("Wrote landscape config file to %s", LSC_CLIENT_CFG_FILE)
util.write_file(LS_DEFAULT_FILE, "RUN=1\n")
+ util.subp(["service", "landscape-client", "restart"])
def merge_together(objs):