~ubuntu-branches/ubuntu/saucy/cloud-init/saucy

« back to all changes in this revision

Viewing changes to cloudinit/config/cc_landscape.py

  • Committer: Package Import Robot
  • Author(s): Scott Moser
  • Date: 2012-11-14 15:18:50 UTC
  • mto: (245.3.3 raring-proposed)
  • mto: This revision was merged to the branch mainline in revision 290.
  • Revision ID: package-import@ubuntu.com-20121114151850-8f1u0o17ta9dwkrt
* New upstream release.
  * landscape: install landscape-client package if not installed.
    only take action if cloud-config is present (LP: #1066115)
  * landscape: restart landscape after install or config (LP: #1070345)
  * multipart/archive: do not fail on unknown headers in multipart
    mime or cloud-archive config (LP: #1065116).
  * tools/Z99-cloud-locale-test.sh: avoid warning when user's shell is
    zsh (LP: #1073077)
  * fix stack trace when unknown user-data input had unicode (LP: #1075756)
  * split 'apt-update-upgrade' config module into 'apt-configure' and
    'package-update-upgrade-install'.  The 'package-update-upgrade-install'
    will be a cross distro module.
  * fix bug where cloud-config from user-data could not affect system_info
    settings (LP: #1076811)
  * add yum_add_repo configuration module for adding additional yum repos
  * fix public key importing with config-drive-v2 datasource (LP: #1077700)
  * handle renaming and fixing up of marker names (LP: #1075980)
    this relieves that burden from the distro/packaging.
  * group config: fix how group members weren't being translated correctly
    when the group: [member, member...] format was used (LP: #1077245)
  * work around an issue with boto > 0.6.0 that lazy loaded the return from 
    get_instance_metadata().  This resulted in failure for cloud-init to
    install ssh keys. (LP: #1068801)
  * add power_state_change config module for shutting down stystem after
    cloud-init finishes. (LP: #1064665)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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))
 
62
    if not ls_cloudcfg:
 
63
        return
 
64
 
 
65
    cloud.distro.install_packages(["landscape-client"])
62
66
 
63
67
    merge_data = [
64
68
        LSC_BUILTIN_CFG,
65
 
        cloud.paths.join(True, LSC_CLIENT_CFG_FILE),
 
69
        LSC_CLIENT_CFG_FILE,
66
70
        ls_cloudcfg,
67
71
    ]
68
72
    merged = merge_together(merge_data)
69
 
 
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)
74
 
 
75
73
    contents = StringIO()
76
74
    merged.write(contents)
77
 
    contents.flush()
78
 
 
79
 
    util.write_file(lsc_client_fn, contents.getvalue())
80
 
    log.debug("Wrote landscape config file to %s", lsc_client_fn)
81
 
 
82
 
    if ls_cloudcfg:
83
 
        util.write_file(LS_DEFAULT_FILE, "RUN=1\n")
 
75
 
 
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)
 
79
 
 
80
    util.write_file(LS_DEFAULT_FILE, "RUN=1\n")
 
81
    util.subp(["service", "landscape-client", "restart"])
84
82
 
85
83
 
86
84
def merge_together(objs):