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"]} )