summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-07-31 13:59:12 -0400
committerScott Moser <smoser@ubuntu.com>2014-07-31 13:59:12 -0400
commit9aafd6e78bb30c160d9cce5835314b67e86d0328 (patch)
treea3fdf4e173ec5e109815eba7972c618d35060ee9 /cloudinit
parent0a44214233860122bbb91edc8d91a7f33a94d859 (diff)
downloadvyos-cloud-init-9aafd6e78bb30c160d9cce5835314b67e86d0328.tar.gz
vyos-cloud-init-9aafd6e78bb30c160d9cce5835314b67e86d0328.zip
fix for config, allow specifying target for cloud-init --single
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/config/cc_ubuntu_init_switch.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/cloudinit/config/cc_ubuntu_init_switch.py b/cloudinit/config/cc_ubuntu_init_switch.py
index 3a2015e5..c476c51c 100644
--- a/cloudinit/config/cc_ubuntu_init_switch.py
+++ b/cloudinit/config/cc_ubuntu_init_switch.py
@@ -63,15 +63,19 @@ fi
"""
-def handle(name, cfg, cloud, log, _args):
+def handle(name, cfg, cloud, log, args):
if not isinstance(cloud.distro, ubuntu.Distro):
log.debug("%s: distro is '%s', not ubuntu. returning",
name, cloud.distro.__class__)
return
- cfg = util.mergemanydict(cfg, DEFAULT_CONFIG)
+ cfg = util.mergemanydict([cfg, DEFAULT_CONFIG])
target = cfg['init_switch']['target']
+
+ if len(args) != 0:
+ target = args[0]
+
if not target:
log.debug("%s: target=%s. nothing to do", name, target)
return