From c12adde776fe334a972f184f8d4cfbb1efb4e32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Simas?= Date: Mon, 20 May 2024 10:52:47 -0300 Subject: [PATCH] fix zones constrains list parsing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luís Simas --- juju/constraints.py | 2 +- tests/unit/test_constraints.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/juju/constraints.py b/juju/constraints.py index 2574b6b08..3315feadc 100644 --- a/juju/constraints.py +++ b/juju/constraints.py @@ -54,7 +54,7 @@ "zones", "allocate_public_ip"] -LIST_KEYS = {'tags', 'spaces'} +LIST_KEYS = {'tags', 'spaces', 'zones'} SNAKE1 = re.compile(r'(.)([A-Z][a-z]+)') SNAKE2 = re.compile('([a-z0-9])([A-Z])') diff --git a/tests/unit/test_constraints.py b/tests/unit/test_constraints.py index 03b2013f7..1fac2ccd6 100644 --- a/tests/unit/test_constraints.py +++ b/tests/unit/test_constraints.py @@ -60,7 +60,7 @@ def test_parse_constraints(self): self.assertEqual( _("mem=10G zones=bar,baz tags=tag1 spaces=space1,space2"), {"mem": 10 * 1024, - "zones": "bar,baz", + "zones": ["bar", "baz"], "tags": ["tag1"], "spaces": ["space1", "space2"]} )