summaryrefslogtreecommitdiff
path: root/cloudinit/CloudConfig/cc_landscape.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/CloudConfig/cc_landscape.py')
-rw-r--r--cloudinit/CloudConfig/cc_landscape.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/cloudinit/CloudConfig/cc_landscape.py b/cloudinit/CloudConfig/cc_landscape.py
index e3e4f7ba..596fd67e 100644
--- a/cloudinit/CloudConfig/cc_landscape.py
+++ b/cloudinit/CloudConfig/cc_landscape.py
@@ -1,8 +1,10 @@
# vi: ts=4 expandtab
#
# Copyright (C) 2011 Canonical Ltd.
+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
#
# Author: Scott Moser <scott.moser@canonical.com>
+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
@@ -15,6 +17,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
from cloudinit.CloudConfig import per_instance
from configobj import ConfigObj
@@ -23,7 +26,7 @@ frequency = per_instance
lsc_client_cfg_file = "/etc/landscape/client.conf"
# defaults taken from stock client.conf in landscape-client 11.07.1.1-0ubuntu2
-lsc_builtincfg = {
+lsc_builtincfg = {
'client': {
'log_level': "info",
'url': "https://landscape.canonical.com/message-system",
@@ -32,14 +35,15 @@ lsc_builtincfg = {
}
}
-def handle(name,cfg,cloud,log,args):
+
+def handle(_name, cfg, _cloud, log, _args):
"""
Basically turn a top level 'landscape' entry with a 'client' dict
and render it to ConfigObj format under '[client]' section in
/etc/landscape/client.conf
"""
- ls_cloudcfg = cfg.get("landscape", { })
+ ls_cloudcfg = cfg.get("landscape", {})
if not isinstance(ls_cloudcfg, dict):
raise(Exception("'landscape' existed in config, but not a dict"))
@@ -51,6 +55,7 @@ def handle(name,cfg,cloud,log,args):
log.debug("updated %s" % lsc_client_cfg_file)
+
def mergeTogether(objs):
"""
merge together ConfigObj objects or things that ConfigObj() will take in