From 858ce946bb001ffc8068af584df21f7e2f6b148f Mon Sep 17 00:00:00 2001 From: David Ames Date: Tue, 16 May 2017 11:11:53 -0700 Subject: [PATCH] Do not install NTP when installed in a container Check if the charm is installed inside a container and do not install NTP if that is the case. Partial-Bug: #1690513 Change-Id: Ib290733a175197dee1261043a1e8ff2edc0b53e5 --- hooks/hooks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hooks/hooks.py b/hooks/hooks.py index cb3a01b5..fccad357 100755 --- a/hooks/hooks.py +++ b/hooks/hooks.py @@ -40,7 +40,10 @@ from charmhelpers.fetch import ( filter_installed_packages, ) from charmhelpers.payload.execd import execd_preinstall -from charmhelpers.core.host import cmp_pkgrevno +from charmhelpers.core.host import ( + cmp_pkgrevno, + is_container, +) from charmhelpers.contrib.network.ip import ( get_relation_ip, get_iface_for_address, @@ -103,6 +106,8 @@ APACHE_PACKAGES = [ def install_packages(): add_source(config('source'), config('key')) apt_update(fatal=True) + if is_container(): + PACKAGES.remove('ntp') pkgs = filter_installed_packages(PACKAGES) if pkgs: status_set('maintenance', 'Installing radosgw packages')