← Back to team overview

cloud-init-dev team mailing list archive

[Merge] lp:~therve/cloud-init/landscape-conf-permissions into lp:cloud-init

 

Thomas Herve has proposed merging lp:~therve/cloud-init/landscape-conf-permissions into lp:cloud-init.

Requested reviews:
  cloud init development team (cloud-init-dev)
Related bugs:
  Bug #1066115 in cloud-init: "The landscape client plugin doesn't create the config file with the proper permissions"
  https://bugs.launchpad.net/cloud-init/+bug/1066115

For more details, see:
https://code.launchpad.net/~therve/cloud-init/landscape-conf-permissions/+merge/129618

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.
-- 
https://code.launchpad.net/~therve/cloud-init/landscape-conf-permissions/+merge/129618
Your team cloud init development team is requested to review the proposed merge of lp:~therve/cloud-init/landscape-conf-permissions into lp:cloud-init.
=== 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 @@
         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 @@
     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):


Follow ups