sts-sponsors team mailing list archive
-
sts-sponsors team
-
Mailing list archive
-
Message #03900
[Merge] ~adam-collard/maas:architecture-wildcard-constraint into maas:master
Adam Collard has proposed merging ~adam-collard/maas:architecture-wildcard-constraint into maas:master.
Commit message:
wildcard architectures returns a list, use .extend() not .append()
Requested reviews:
MAAS Maintainers (maas-maintainers)
For more details, see:
https://code.launchpad.net/~adam-collard/maas/+git/maas/+merge/434358
--
Your team MAAS Committers is subscribed to branch maas:master.
diff --git a/src/maasserver/node_constraint_filter_forms.py b/src/maasserver/node_constraint_filter_forms.py
index 53e5ccd..12dce7f 100644
--- a/src/maasserver/node_constraint_filter_forms.py
+++ b/src/maasserver/node_constraint_filter_forms.py
@@ -1025,7 +1025,7 @@ class FilterNodeForm(forms.Form):
elif value in architecture_wildcards:
# Try to expand 'arch' to all available 'arch/subarch'
# matches.
- arches.append(*architecture_wildcards[value])
+ arches.extend(architecture_wildcards[value])
else:
set_form_error(
self,
diff --git a/src/maasserver/tests/test_node_constraint_filter_forms.py b/src/maasserver/tests/test_node_constraint_filter_forms.py
index 0f5ac2c..1222323 100644
--- a/src/maasserver/tests/test_node_constraint_filter_forms.py
+++ b/src/maasserver/tests/test_node_constraint_filter_forms.py
@@ -1444,6 +1444,11 @@ class TestFilterNodeForm(MAASServerTestCase, FilterConstraintsMixin):
[node_big], {"arch": arch, "tags": ["big"]}
)
+ def test_wildcard_arch_constraint(self):
+ patch_usable_architectures(self, ["foo/bar", "foo/baz"])
+ form = FilterNodeForm(data={"arch": "foo"})
+ self.assertTrue(form.is_valid())
+
def test_invalid_combined_constraints(self):
form = FilterNodeForm(data={"tags": ["unknown"], "arch": "invalid"})
self.assertEqual(
Follow ups