← Back to team overview

canonical-ubuntu-qa team mailing list archive

[Merge] ~andersson123/autopkgtest-cloud:update-deps-mojo-run-move-pkgs-to-basic into autopkgtest-cloud:master

 

Tim Andersson has proposed merging ~andersson123/autopkgtest-cloud:update-deps-mojo-run-move-pkgs-to-basic into autopkgtest-cloud:master.

Requested reviews:
  Canonical's Ubuntu QA (canonical-ubuntu-qa)

For more details, see:
https://code.launchpad.net/~andersson123/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/456171
-- 
Your team Canonical's Ubuntu QA is requested to review the proposed merge of ~andersson123/autopkgtest-cloud:update-deps-mojo-run-move-pkgs-to-basic into autopkgtest-cloud:master.
diff --git a/charms/focal/autopkgtest-cloud-worker/layer.yaml b/charms/focal/autopkgtest-cloud-worker/layer.yaml
index 4aeb04d..692d9af 100644
--- a/charms/focal/autopkgtest-cloud-worker/layer.yaml
+++ b/charms/focal/autopkgtest-cloud-worker/layer.yaml
@@ -10,9 +10,6 @@ options:
       - gir1.2-glib-2.0
       - python3-gi
       - python3-pygit2
-    include_system_packages: true
-  apt:
-    packages:
       - bsd-mailx
       - dctrl-tools
       - distro-info
@@ -32,3 +29,4 @@ options:
       - python3-openstackclient
       - python3-swiftclient
       - ssmtp
+    include_system_packages: true
diff --git a/charms/focal/autopkgtest-cloud-worker/reactive/autopkgtest_cloud_worker.py b/charms/focal/autopkgtest-cloud-worker/reactive/autopkgtest_cloud_worker.py
index 2095e42..f39705d 100644
--- a/charms/focal/autopkgtest-cloud-worker/reactive/autopkgtest_cloud_worker.py
+++ b/charms/focal/autopkgtest-cloud-worker/reactive/autopkgtest_cloud_worker.py
@@ -184,6 +184,13 @@ def daemon_reload():
     clear_flag("autopkgtest.daemon-reload-needed")
 
 
+@hook("upgrade-charm")
+def install_apt_packages():
+    """Install packages defined in layer.yaml"""
+    set_flag("apt.needs_update")
+    clear_flag("apt.queued_installs")
+
+
 @hook("install")
 def enable_persistent_journal():
     try:
diff --git a/charms/focal/autopkgtest-web/layer.yaml b/charms/focal/autopkgtest-web/layer.yaml
index 1afa35d..5c81bdb 100644
--- a/charms/focal/autopkgtest-web/layer.yaml
+++ b/charms/focal/autopkgtest-web/layer.yaml
@@ -6,7 +6,7 @@ includes:
   - 'interface:rabbitmq'
   - 'interface:apache-website'
 options:
-  apt:
+  basic:
     packages:
       - amqp-tools
       - distro-info
@@ -21,3 +21,4 @@ options:
       - python3-flask-openid
       - python3-swiftclient
       - python3-werkzeug
+    include_system_packages: true
diff --git a/charms/focal/autopkgtest-web/reactive/autopkgtest_web.py b/charms/focal/autopkgtest-web/reactive/autopkgtest_web.py
index 842348b..db60fcb 100644
--- a/charms/focal/autopkgtest-web/reactive/autopkgtest_web.py
+++ b/charms/focal/autopkgtest-web/reactive/autopkgtest_web.py
@@ -8,6 +8,7 @@ from charmhelpers.core.hookenv import charm_dir, config
 from charms.layer import status
 from charms.reactive import (
     clear_flag,
+    hook,
     set_flag,
     when,
     when_all,
@@ -25,6 +26,13 @@ SWIFT_WEB_CREDENTIALS_PATH = os.path.expanduser(
 )
 
 
+@hook("upgrade-charm")
+def install_apt_packages():
+    """Install packages defined in layer.yaml"""
+    set_flag("apt.needs_update")
+    clear_flag("apt.queued_installs")
+
+
 @when_not("autopkgtest-web.autopkgtest_web_symlinked")
 def symlink_autopkgtest_cloud():
     try:

Follow ups