59
59
raise RuntimeError(("'landscape' key existed in config,"
60
60
" but not a dictionary type,"
61
61
" is a %s instead"), util.obj_name(ls_cloudcfg))
65
cloud.distro.install_packages(["landscape-client"])
65
cloud.paths.join(True, LSC_CLIENT_CFG_FILE),
68
72
merged = merge_together(merge_data)
70
lsc_client_fn = cloud.paths.join(False, LSC_CLIENT_CFG_FILE)
71
lsc_dir = cloud.paths.join(False, os.path.dirname(lsc_client_fn))
72
if not os.path.isdir(lsc_dir):
73
util.ensure_dir(lsc_dir)
75
73
contents = StringIO()
76
74
merged.write(contents)
79
util.write_file(lsc_client_fn, contents.getvalue())
80
log.debug("Wrote landscape config file to %s", lsc_client_fn)
83
util.write_file(LS_DEFAULT_FILE, "RUN=1\n")
76
util.ensure_dir(os.path.dirname(LSC_CLIENT_CFG_FILE))
77
util.write_file(LSC_CLIENT_CFG_FILE, contents.getvalue())
78
log.debug("Wrote landscape config file to %s", LSC_CLIENT_CFG_FILE)
80
util.write_file(LS_DEFAULT_FILE, "RUN=1\n")
81
util.subp(["service", "landscape-client", "restart"])
86
84
def merge_together(objs):