From 6bfbe2409aa1a5768a4200c06ac5d4dde7486fd1 Mon Sep 17 00:00:00 2001 From: Jack Shaw Date: Wed, 26 Jun 2024 11:52:29 +0100 Subject: [PATCH] fix(series): add noble support The pylibjuju client hardcodes a mapping between series codename and the base channel. Noble was absent from this mapping, meaning pylibjuju doesn't know know to deploy to noble. Add noble to this mapping. After noble, we will only support deploying by base. Noble will be the last series added to this map Add an integration test which deploys a charm to noble --- juju/utils.py | 2 ++ tests/integration/charm-manifest/manifest.yaml | 4 ++++ tests/integration/test_model.py | 9 +++++++++ 3 files changed, 15 insertions(+) diff --git a/juju/utils.py b/juju/utils.py index 1b6854f7..c4f4780a 100644 --- a/juju/utils.py +++ b/juju/utils.py @@ -301,6 +301,7 @@ def get_local_charm_charmcraft_yaml(path): KINETIC = "kinetic" LUNAR = "lunar" MANTIC = "mantic" +NOBLE = "noble" UBUNTU_SERIES = { PRECISE: "12.04", @@ -327,6 +328,7 @@ def get_local_charm_charmcraft_yaml(path): KINETIC: "22.10", LUNAR: "23.04", MANTIC: "23.10", + NOBLE: "24.04", } KUBERNETES = "kubernetes" diff --git a/tests/integration/charm-manifest/manifest.yaml b/tests/integration/charm-manifest/manifest.yaml index dbb75e78..37c9d7ec 100644 --- a/tests/integration/charm-manifest/manifest.yaml +++ b/tests/integration/charm-manifest/manifest.yaml @@ -9,5 +9,9 @@ bases: - amd64 channel: '20.04' name: ubuntu +- architectures: + - amd64 + channel: '24.04' + name: ubuntu charmcraft-started-at: '2021-08-20T08:09:00.639806Z' charmcraft-version: 1.2.1 diff --git a/tests/integration/test_model.py b/tests/integration/test_model.py index d10e3fbb..8d213553 100644 --- a/tests/integration/test_model.py +++ b/tests/integration/test_model.py @@ -437,6 +437,15 @@ async def test_deploy_with_base(): await model.wait_for_idle(status='active') +@base.bootstrapped +async def test_deploy_noble(): + charm_path = INTEGRATION_TEST_DIR / 'charm-manifest' + + async with base.CleanModel() as model: + await model.deploy(str(charm_path), base="ubuntu@24.04") + await model.wait_for_idle(status='active') + + @base.bootstrapped async def test_add_machine(): from juju.machine import Machine