← Back to team overview

canonical-ubuntu-qa team mailing list archive

[Merge] ~andersson123/autopkgtest-cloud:charms-handle-new-deps into autopkgtest-cloud:master

 

Tim Andersson has proposed merging ~andersson123/autopkgtest-cloud:charms-handle-new-deps 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/455908
-- 
Your team Canonical's Ubuntu QA is requested to review the proposed merge of ~andersson123/autopkgtest-cloud:charms-handle-new-deps into autopkgtest-cloud:master.
diff --git a/charms/focal/autopkgtest-cloud-worker/config.yaml b/charms/focal/autopkgtest-cloud-worker/config.yaml
index 7f0ef60..ec6ad2b 100644
--- a/charms/focal/autopkgtest-cloud-worker/config.yaml
+++ b/charms/focal/autopkgtest-cloud-worker/config.yaml
@@ -110,3 +110,7 @@ options:
     description: Submit all metrics with this as the "context" tag,
                  to differentiate staging vs. production submissions
     type: string
+  required-packages:
+    default: ~
+    description: List of apt packages required for the charm to function.
+    type: string
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..ce20153 100644
--- a/charms/focal/autopkgtest-cloud-worker/reactive/autopkgtest_cloud_worker.py
+++ b/charms/focal/autopkgtest-cloud-worker/reactive/autopkgtest_cloud_worker.py
@@ -293,6 +293,16 @@ def enable_units_initially():
     enable_disable_units()
 
 
+@when_any("config.default.required-packages")
+def update_apt_deps():
+    # add function here to update apt dependencies
+    # remember to set config.required-packages at the end
+    # the idea is that a mojo run sets config.required-packages
+    # to the default value. Then whenever this config variable is
+    # set to default, the dependencies are checked and installed if necessary.
+    pass
+
+
 @when_all(
     "autopkgtest.autopkgtest_cloud_symlinked",
     "autopkgtest.systemd_units_linked_and_enabled",
diff --git a/mojo/service-bundle b/mojo/service-bundle
index 26b74c0..6749025 100644
--- a/mojo/service-bundle
+++ b/mojo/service-bundle
@@ -40,6 +40,7 @@ applications:
             influxdb-hostname: include-file://{{ local_dir }}/influx-hostname.txt
             influxdb-password: include-file://{{ local_dir }}/influx-password.txt
             influxdb-database: metrics
+            required-packages: default
 {%- if stage_name == "production" %}
             influxdb-username: prod_proposed_migration
             influxdb-context: production

References