From 6804d77b7a8ef65dfbbef6f9fe670275770d01c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Simas?= Date: Fri, 17 May 2024 13:17:12 -0300 Subject: [PATCH] fix zones constrains list parsing --- 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"]} )