summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_snappy.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-03-26 22:16:13 -0400
committerScott Moser <smoser@ubuntu.com>2015-03-26 22:16:13 -0400
commit5e012b1e5f51f82e503a760c8c9c0e2c66aedfee (patch)
tree74daceb9c0de0b7008ebf8b3cace49715db75adb /cloudinit/config/cc_snappy.py
parent4c341a87d4b0804565e74e6335a0293dab6c0c7b (diff)
downloadvyos-cloud-init-5e012b1e5f51f82e503a760c8c9c0e2c66aedfee.tar.gz
vyos-cloud-init-5e012b1e5f51f82e503a760c8c9c0e2c66aedfee.zip
prefer snappy-go to snappy
Diffstat (limited to 'cloudinit/config/cc_snappy.py')
-rw-r--r--cloudinit/config/cc_snappy.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/cloudinit/config/cc_snappy.py b/cloudinit/config/cc_snappy.py
index bd928e54..dbdc402c 100644
--- a/cloudinit/config/cc_snappy.py
+++ b/cloudinit/config/cc_snappy.py
@@ -168,6 +168,14 @@ def system_is_snappy():
return False
+def set_snappy_command():
+ if util.which("snappy-go"):
+ SNAPPY_COMMAND = "snappy-go"
+ else:
+ SNAPPY_COMMAND = "snappy"
+ LOG.debug("snappy command is '%s'", SNAPPY_COMMAND)
+
+
def handle(name, cfg, cloud, log, args):
cfgin = cfg.get('snappy')
if not cfgin:
@@ -187,11 +195,12 @@ def handle(name, cfg, cloud, log, args):
configs=mycfg['configs'],
fspath=mycfg['packages_dir'])
+ set_snappy_command()
+
fails = []
for pkg_op in pkg_ops:
try:
- render_snap_op(op=pkg_op['op'], name=pkg_op['name'],
- cfgfile=pkg_op['cfgfile'], config=pkg_op['config'])
+ render_snap_op(**pkg_op)
except Exception as e:
fails.append((pkg_op, e,))
LOG.warn("'%s' failed for '%s': %s",