From eb6f294ff89696651b6ba4bda97f05ed6e0dfcf0 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 31 Jul 2014 14:18:55 -0400 Subject: exit and warn if no 'dpkg' (probably wrong distro) --- cloudinit/config/cc_ubuntu_init_switch.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cloudinit/config') diff --git a/cloudinit/config/cc_ubuntu_init_switch.py b/cloudinit/config/cc_ubuntu_init_switch.py index faa41ede..485c46a4 100644 --- a/cloudinit/config/cc_ubuntu_init_switch.py +++ b/cloudinit/config/cc_ubuntu_init_switch.py @@ -102,6 +102,10 @@ def handle(name, cfg, cloud, log, args): log.debug("%s: target=%s. nothing to do", name, target) return + if not util.which('dpkg'): + log.warn("%s: 'dpkg' not available. Assuming not ubuntu", name) + return + supported = ('upstart', 'systemd') if target not in supported: log.warn("%s: target set to %s, expected one of: %s", -- cgit v1.2.3