~evarlast/cloud-init/cloud-init

« back to all changes in this revision

Viewing changes to debian/patches/lp-1066115-landscape-install-fix-perms.patch

  • Committer: Package Import Robot
  • Author(s): Scott Moser
  • Date: 2012-11-12 17:01:54 UTC
  • Revision ID: package-import@ubuntu.com-20121112170154-37170939vlg68nst
Tags: 0.6.3-0ubuntu1.2
* debian/patches/lp-978127-maas-oauth-fix-bad-clock.patch: fix usage of
  oauth in maas data source if local system has a bad clock (LP: #978127)
* debian/cloud-init.preinst: fix bug where user data scripts re-ran on
  upgrade from 10.04 versions (LP: #1049146)
* debian/patches/lp-974509-detect-dns-server-redirection.patch: detect dns
  server redirection and disable searching dns for a mirror named
  'ubuntu-mirror' (LP: #974509)
* debian/patches/lp-1018554-shutdown-message-to-console.patch: write a
  message to the console on system shutdown. (LP: #1018554)
* debian/patches/lp-1066115-landscape-install-fix-perms.patch: install
  landscape package if needed which will ensure proper permissions on config
  file (LP: #1066115).
* debian/patches/lp-1070345-landscape-restart-after-change.patch: restart
  landscape after modifying config (LP: #1070345)
* debian/patches/lp-1073077-zsh-workaround-for-locale_warn.patch: avoid
  warning when user's shell is zsh (LP: #1073077)
* debian/patches/rework-mirror-selection.patch: improve mirror selection by:
  * allowing region/availability-zone to be part of mirror (LP: #1037727)
  * making mirror selection arch aware (LP: #1028501)
  * allow specification of a security mirror (LP: #1006963)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Author: Scott Moser <smoser@ubuntu.com>
 
2
Origin: upstream
 
3
Bug: https://launchpad.net/bugs/1066115
 
4
Applied-Upstream: revno 687
 
5
Description:  do nothing if config not given. install landscape-client.
 
6
 Skip all the work when there is no config section.
 
7
 Then enforce the package installation, which will create the config file with
 
8
 the proper permissions.
 
9
--- a/cloudinit/CloudConfig/cc_landscape.py
 
10
+++ b/cloudinit/CloudConfig/cc_landscape.py
 
11
@@ -51,6 +51,11 @@ def handle(_name, cfg, _cloud, log, _arg
 
12
     if not isinstance(ls_cloudcfg, dict):
 
13
         raise(Exception("'landscape' existed in config, but not a dict"))
 
14
 
 
15
+    if not ls_cloudcfg:
 
16
+        return
 
17
+
 
18
+    util.install_packages(["landscape-client"])
 
19
+
 
20
     merged = mergeTogether([lsc_builtincfg, lsc_client_cfg_file, ls_cloudcfg])
 
21
 
 
22
     if not os.path.isdir(os.path.dirname(lsc_client_cfg_file)):
 
23
@@ -59,9 +64,8 @@ def handle(_name, cfg, _cloud, log, _arg
 
24
     with open(lsc_client_cfg_file, "w") as fp:
 
25
         merged.write(fp)
 
26
 
 
27
-    if ls_cloudcfg:
 
28
-        with open(lsc_client_default_file, "w") as fp:
 
29
-            fp.write("RUN=1\n")
 
30
+    with open(lsc_client_default_file, "w") as fp:
 
31
+        fp.write("RUN=1\n")
 
32
 
 
33
     log.debug("updated %s" % lsc_client_cfg_file)
 
34