Merge ~cgrabowski/maas:add_field_type_to_filter_groups into maas:master
- Git
- lp:~cgrabowski/maas
- add_field_type_to_filter_groups
- Merge into master
Status: | Merged |
---|---|
Approved by: | Christian Grabowski |
Approved revision: | 157a7a834c74f8d6d0d6f54da0d9e1bccbf766db |
Merge reported by: | MAAS Lander |
Merged at revision: | not available |
Proposed branch: | ~cgrabowski/maas:add_field_type_to_filter_groups |
Merge into: | maas:master |
Diff against target: |
344 lines (+89/-0) 4 files modified
src/maasserver/node_constraint_filter_forms.py (+19/-0) src/maasserver/tests/test_node_constraint_filter_forms.py (+35/-0) src/maasserver/websockets/handlers/node.py (+2/-0) src/maasserver/websockets/handlers/tests/test_machine.py (+33/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
MAAS Lander | Approve | ||
Alexsander de Souza | Approve | ||
Review via email: mp+426582@code.launchpad.net |
Commit message
expand complex types
add type field to filter_groups endpoint
Description of the change
Alexsander de Souza (alexsander-souza) wrote : | # |
comments inline
Christian Grabowski (cgrabowski) : | # |
MAAS Lander (maas-lander) wrote : | # |
UNIT TESTS
-b add_field_
STATUS: FAILED
LOG: http://
COMMIT: 48f2a45649e4a73
Alexsander de Souza (alexsander-souza) : | # |
Christian Grabowski (cgrabowski) : | # |
MAAS Lander (maas-lander) wrote : | # |
UNIT TESTS
-b add_field_
STATUS: FAILED
LOG: http://
COMMIT: b650b20349dad97
Alexsander de Souza (alexsander-souza) wrote : | # |
+1
MAAS Lander (maas-lander) wrote : | # |
UNIT TESTS
-b add_field_
STATUS: FAILED
LOG: http://
COMMIT: bfc406c0102bd0c
MAAS Lander (maas-lander) wrote : | # |
UNIT TESTS
-b add_field_
STATUS: FAILED
LOG: http://
COMMIT: 1663f37f3e390e3
MAAS Lander (maas-lander) wrote : | # |
UNIT TESTS
-b add_field_
STATUS: FAILED
LOG: http://
COMMIT: a05feb41c747869
MAAS Lander (maas-lander) wrote : | # |
UNIT TESTS
-b add_field_
STATUS: FAILED
LOG: http://
COMMIT: 659ff302c1d5015
MAAS Lander (maas-lander) wrote : | # |
UNIT TESTS
-b add_field_
STATUS: FAILED
LOG: http://
COMMIT: 157a7a834c74f8d
Christian Grabowski (cgrabowski) wrote : | # |
jenkins: !test
MAAS Lander (maas-lander) wrote : | # |
UNIT TESTS
-b add_field_
STATUS: SUCCESS
COMMIT: 157a7a834c74f8d
MAAS Lander (maas-lander) wrote : | # |
LANDING
-b add_field_
STATUS: FAILED BUILD
LOG: http://
Preview Diff
1 | diff --git a/src/maasserver/node_constraint_filter_forms.py b/src/maasserver/node_constraint_filter_forms.py | |||
2 | index 1a4a765..71cf351 100644 | |||
3 | --- a/src/maasserver/node_constraint_filter_forms.py | |||
4 | +++ b/src/maasserver/node_constraint_filter_forms.py | |||
5 | @@ -679,6 +679,25 @@ GROUPABLE_FIELDS = ( | |||
6 | 679 | ) | 679 | ) |
7 | 680 | 680 | ||
8 | 681 | 681 | ||
9 | 682 | ARGUMENT_TYPES_BY_FIELD_TYPE = { | ||
10 | 683 | "int": (forms.IntegerField, forms.ChoiceField), | ||
11 | 684 | "float": (forms.FloatField,), | ||
12 | 685 | "string": (forms.CharField,), | ||
13 | 686 | "list": (ValidatorMultipleChoiceField, UnconstrainedMultipleChoiceField), | ||
14 | 687 | "dict[string,string]": (LabeledConstraintMapField,), | ||
15 | 688 | } | ||
16 | 689 | |||
17 | 690 | |||
18 | 691 | def get_field_argument_type(field): | ||
19 | 692 | for arg_type, field_types in ARGUMENT_TYPES_BY_FIELD_TYPE.items(): | ||
20 | 693 | if type(field) in field_types: | ||
21 | 694 | if arg_type == "list": | ||
22 | 695 | # currently all multichoice fields take strings, this will need to be expanded if that changes | ||
23 | 696 | return "list[string]" | ||
24 | 697 | return arg_type | ||
25 | 698 | return "unknown" | ||
26 | 699 | |||
27 | 700 | |||
28 | 682 | class FilterNodeForm(RenamableFieldsForm): | 701 | class FilterNodeForm(RenamableFieldsForm): |
29 | 683 | """A form for filtering nodes.""" | 702 | """A form for filtering nodes.""" |
30 | 684 | 703 | ||
31 | diff --git a/src/maasserver/tests/test_node_constraint_filter_forms.py b/src/maasserver/tests/test_node_constraint_filter_forms.py | |||
32 | index df67c69..e980944 100644 | |||
33 | --- a/src/maasserver/tests/test_node_constraint_filter_forms.py | |||
34 | +++ b/src/maasserver/tests/test_node_constraint_filter_forms.py | |||
35 | @@ -24,6 +24,10 @@ from maasserver.enum import ( | |||
36 | 24 | NODE_STATUS, | 24 | NODE_STATUS, |
37 | 25 | POWER_STATE, | 25 | POWER_STATE, |
38 | 26 | ) | 26 | ) |
39 | 27 | from maasserver.forms import ( | ||
40 | 28 | UnconstrainedMultipleChoiceField, | ||
41 | 29 | ValidatorMultipleChoiceField, | ||
42 | 30 | ) | ||
43 | 27 | from maasserver.models import Domain, Machine, NodeDevice, Tag, Zone | 31 | from maasserver.models import Domain, Machine, NodeDevice, Tag, Zone |
44 | 28 | from maasserver.node_constraint_filter_forms import ( | 32 | from maasserver.node_constraint_filter_forms import ( |
45 | 29 | AcquireNodeForm, | 33 | AcquireNodeForm, |
46 | @@ -32,6 +36,7 @@ from maasserver.node_constraint_filter_forms import ( | |||
47 | 32 | FreeTextFilterNodeForm, | 36 | FreeTextFilterNodeForm, |
48 | 33 | generate_architecture_wildcards, | 37 | generate_architecture_wildcards, |
49 | 34 | get_architecture_wildcards, | 38 | get_architecture_wildcards, |
50 | 39 | get_field_argument_type, | ||
51 | 35 | get_storage_constraints_from_string, | 40 | get_storage_constraints_from_string, |
52 | 36 | JUJU_ACQUIRE_FORM_FIELDS_MAPPING, | 41 | JUJU_ACQUIRE_FORM_FIELDS_MAPPING, |
53 | 37 | nodes_by_interface, | 42 | nodes_by_interface, |
54 | @@ -2209,3 +2214,33 @@ class TestReadNodesForm(MAASServerTestCase, FilterConstraintsMixin): | |||
55 | 2209 | node3 = factory.make_Node(status=NODE_STATUS.NEW) | 2214 | node3 = factory.make_Node(status=NODE_STATUS.NEW) |
56 | 2210 | self.assertConstrainedNodes([node1, node3], {"status": "new"}) | 2215 | self.assertConstrainedNodes([node1, node3], {"status": "new"}) |
57 | 2211 | self.assertConstrainedNodes([node2], {"status": "deploying"}) | 2216 | self.assertConstrainedNodes([node2], {"status": "deploying"}) |
58 | 2217 | |||
59 | 2218 | |||
60 | 2219 | class TestGetFieldArgumentType(MAASServerTestCase): | ||
61 | 2220 | def test_get_IntegerField_type(self): | ||
62 | 2221 | field = forms.IntegerField() | ||
63 | 2222 | self.assertEqual(get_field_argument_type(field), "int") | ||
64 | 2223 | |||
65 | 2224 | def test_get_ChoiceField_type(self): | ||
66 | 2225 | field = forms.ChoiceField() | ||
67 | 2226 | self.assertEqual(get_field_argument_type(field), "int") | ||
68 | 2227 | |||
69 | 2228 | def test_get_FloatField_type(self): | ||
70 | 2229 | field = forms.FloatField() | ||
71 | 2230 | self.assertEqual(get_field_argument_type(field), "float") | ||
72 | 2231 | |||
73 | 2232 | def test_get_CharField_type(self): | ||
74 | 2233 | field = forms.CharField() | ||
75 | 2234 | self.assertEqual(get_field_argument_type(field), "string") | ||
76 | 2235 | |||
77 | 2236 | def test_get_ValidatorMultipleChoiceField_type(self): | ||
78 | 2237 | field = ValidatorMultipleChoiceField(validator=lambda x: True) | ||
79 | 2238 | self.assertEqual(get_field_argument_type(field), "list[string]") | ||
80 | 2239 | |||
81 | 2240 | def test_get_UnconstrainedMultipleChoiceField_type(self): | ||
82 | 2241 | field = UnconstrainedMultipleChoiceField() | ||
83 | 2242 | self.assertEqual(get_field_argument_type(field), "list[string]") | ||
84 | 2243 | |||
85 | 2244 | def test_get_unknown_type(self): | ||
86 | 2245 | field = forms.Field() | ||
87 | 2246 | self.assertEqual(get_field_argument_type(field), "unknown") | ||
88 | diff --git a/src/maasserver/websockets/handlers/node.py b/src/maasserver/websockets/handlers/node.py | |||
89 | index 7a9fc53..2c0d469 100644 | |||
90 | --- a/src/maasserver/websockets/handlers/node.py | |||
91 | +++ b/src/maasserver/websockets/handlers/node.py | |||
92 | @@ -46,6 +46,7 @@ from maasserver.models.nodeprobeddetails import script_output_nsmap | |||
93 | 46 | from maasserver.node_action import compile_node_actions | 46 | from maasserver.node_action import compile_node_actions |
94 | 47 | from maasserver.node_constraint_filter_forms import ( | 47 | from maasserver.node_constraint_filter_forms import ( |
95 | 48 | FreeTextFilterNodeForm, | 48 | FreeTextFilterNodeForm, |
96 | 49 | get_field_argument_type, | ||
97 | 49 | GROUPABLE_FIELDS, | 50 | GROUPABLE_FIELDS, |
98 | 50 | STATIC_FILTER_FIELDS, | 51 | STATIC_FILTER_FIELDS, |
99 | 51 | ) | 52 | ) |
100 | @@ -1212,6 +1213,7 @@ class NodeHandler(TimestampedModelHandler): | |||
101 | 1212 | { | 1213 | { |
102 | 1213 | "key": name, | 1214 | "key": name, |
103 | 1214 | "label": field.label, | 1215 | "label": field.label, |
104 | 1216 | "type": get_field_argument_type(field), | ||
105 | 1215 | "dynamic": name not in STATIC_FILTER_FIELDS, | 1217 | "dynamic": name not in STATIC_FILTER_FIELDS, |
106 | 1216 | "for_grouping": name in GROUPABLE_FIELDS, | 1218 | "for_grouping": name in GROUPABLE_FIELDS, |
107 | 1217 | } | 1219 | } |
108 | diff --git a/src/maasserver/websockets/handlers/tests/test_machine.py b/src/maasserver/websockets/handlers/tests/test_machine.py | |||
109 | index dae1058..352d4ea 100644 | |||
110 | --- a/src/maasserver/websockets/handlers/tests/test_machine.py | |||
111 | +++ b/src/maasserver/websockets/handlers/tests/test_machine.py | |||
112 | @@ -5903,186 +5903,217 @@ class TestMachineHandlerFilter(MAASServerTestCase): | |||
113 | 5903 | "key": "id", | 5903 | "key": "id", |
114 | 5904 | "label": "System IDs to filter on", | 5904 | "label": "System IDs to filter on", |
115 | 5905 | "dynamic": True, | 5905 | "dynamic": True, |
116 | 5906 | "type": "list[string]", | ||
117 | 5906 | "for_grouping": False, | 5907 | "for_grouping": False, |
118 | 5907 | }, | 5908 | }, |
119 | 5908 | { | 5909 | { |
120 | 5909 | "key": "arch", | 5910 | "key": "arch", |
121 | 5910 | "label": "Architecture", | 5911 | "label": "Architecture", |
122 | 5911 | "dynamic": False, | 5912 | "dynamic": False, |
123 | 5913 | "type": "string", | ||
124 | 5912 | "for_grouping": True, | 5914 | "for_grouping": True, |
125 | 5913 | }, | 5915 | }, |
126 | 5914 | { | 5916 | { |
127 | 5915 | "key": "tags", | 5917 | "key": "tags", |
128 | 5916 | "label": "Tags", | 5918 | "label": "Tags", |
129 | 5917 | "dynamic": True, | 5919 | "dynamic": True, |
130 | 5920 | "type": "list[string]", | ||
131 | 5918 | "for_grouping": True, | 5921 | "for_grouping": True, |
132 | 5919 | }, | 5922 | }, |
133 | 5920 | { | 5923 | { |
134 | 5921 | "key": "not_tags", | 5924 | "key": "not_tags", |
135 | 5922 | "label": "Not having tags", | 5925 | "label": "Not having tags", |
136 | 5923 | "dynamic": True, | 5926 | "dynamic": True, |
137 | 5927 | "type": "list[string]", | ||
138 | 5924 | "for_grouping": False, | 5928 | "for_grouping": False, |
139 | 5925 | }, | 5929 | }, |
140 | 5926 | { | 5930 | { |
141 | 5927 | "key": "fabrics", | 5931 | "key": "fabrics", |
142 | 5928 | "label": "Attached to fabrics", | 5932 | "label": "Attached to fabrics", |
143 | 5929 | "dynamic": True, | 5933 | "dynamic": True, |
144 | 5934 | "type": "list[string]", | ||
145 | 5930 | "for_grouping": True, | 5935 | "for_grouping": True, |
146 | 5931 | }, | 5936 | }, |
147 | 5932 | { | 5937 | { |
148 | 5933 | "key": "not_fabrics", | 5938 | "key": "not_fabrics", |
149 | 5934 | "label": "Not attached to fabrics", | 5939 | "label": "Not attached to fabrics", |
150 | 5935 | "dynamic": True, | 5940 | "dynamic": True, |
151 | 5941 | "type": "list[string]", | ||
152 | 5936 | "for_grouping": False, | 5942 | "for_grouping": False, |
153 | 5937 | }, | 5943 | }, |
154 | 5938 | { | 5944 | { |
155 | 5939 | "key": "fabric_classes", | 5945 | "key": "fabric_classes", |
156 | 5940 | "label": "Attached to fabric with specified classes", | 5946 | "label": "Attached to fabric with specified classes", |
157 | 5941 | "dynamic": True, | 5947 | "dynamic": True, |
158 | 5948 | "type": "list[string]", | ||
159 | 5942 | "for_grouping": True, | 5949 | "for_grouping": True, |
160 | 5943 | }, | 5950 | }, |
161 | 5944 | { | 5951 | { |
162 | 5945 | "key": "not_fabric_classes", | 5952 | "key": "not_fabric_classes", |
163 | 5946 | "label": "Not attached to fabric with specified classes", | 5953 | "label": "Not attached to fabric with specified classes", |
164 | 5947 | "dynamic": True, | 5954 | "dynamic": True, |
165 | 5955 | "type": "list[string]", | ||
166 | 5948 | "for_grouping": False, | 5956 | "for_grouping": False, |
167 | 5949 | }, | 5957 | }, |
168 | 5950 | { | 5958 | { |
169 | 5951 | "key": "subnets", | 5959 | "key": "subnets", |
170 | 5952 | "label": "Attached to subnets", | 5960 | "label": "Attached to subnets", |
171 | 5953 | "dynamic": True, | 5961 | "dynamic": True, |
172 | 5962 | "type": "list[string]", | ||
173 | 5954 | "for_grouping": True, | 5963 | "for_grouping": True, |
174 | 5955 | }, | 5964 | }, |
175 | 5956 | { | 5965 | { |
176 | 5957 | "key": "not_subnets", | 5966 | "key": "not_subnets", |
177 | 5958 | "label": "Not attached to subnets", | 5967 | "label": "Not attached to subnets", |
178 | 5959 | "dynamic": True, | 5968 | "dynamic": True, |
179 | 5969 | "type": "list[string]", | ||
180 | 5960 | "for_grouping": False, | 5970 | "for_grouping": False, |
181 | 5961 | }, | 5971 | }, |
182 | 5962 | { | 5972 | { |
183 | 5963 | "key": "link_speed", | 5973 | "key": "link_speed", |
184 | 5964 | "label": "Link speed", | 5974 | "label": "Link speed", |
185 | 5965 | "dynamic": True, | 5975 | "dynamic": True, |
186 | 5976 | "type": "float", | ||
187 | 5966 | "for_grouping": False, | 5977 | "for_grouping": False, |
188 | 5967 | }, | 5978 | }, |
189 | 5968 | { | 5979 | { |
190 | 5969 | "key": "vlans", | 5980 | "key": "vlans", |
191 | 5970 | "label": "Attached to VLANs", | 5981 | "label": "Attached to VLANs", |
192 | 5971 | "dynamic": True, | 5982 | "dynamic": True, |
193 | 5983 | "type": "list[string]", | ||
194 | 5972 | "for_grouping": True, | 5984 | "for_grouping": True, |
195 | 5973 | }, | 5985 | }, |
196 | 5974 | { | 5986 | { |
197 | 5975 | "key": "not_vlans", | 5987 | "key": "not_vlans", |
198 | 5976 | "label": "Not attached to VLANs", | 5988 | "label": "Not attached to VLANs", |
199 | 5977 | "dynamic": True, | 5989 | "dynamic": True, |
200 | 5990 | "type": "list[string]", | ||
201 | 5978 | "for_grouping": False, | 5991 | "for_grouping": False, |
202 | 5979 | }, | 5992 | }, |
203 | 5980 | { | 5993 | { |
204 | 5981 | "key": "zone", | 5994 | "key": "zone", |
205 | 5982 | "label": "Physical zone", | 5995 | "label": "Physical zone", |
206 | 5983 | "dynamic": True, | 5996 | "dynamic": True, |
207 | 5997 | "type": "string", | ||
208 | 5984 | "for_grouping": True, | 5998 | "for_grouping": True, |
209 | 5985 | }, | 5999 | }, |
210 | 5986 | { | 6000 | { |
211 | 5987 | "key": "not_in_zone", | 6001 | "key": "not_in_zone", |
212 | 5988 | "label": "Not in zone", | 6002 | "label": "Not in zone", |
213 | 5989 | "dynamic": True, | 6003 | "dynamic": True, |
214 | 6004 | "type": "list[string]", | ||
215 | 5990 | "for_grouping": False, | 6005 | "for_grouping": False, |
216 | 5991 | }, | 6006 | }, |
217 | 5992 | { | 6007 | { |
218 | 5993 | "key": "pool", | 6008 | "key": "pool", |
219 | 5994 | "label": "Resource pool", | 6009 | "label": "Resource pool", |
220 | 5995 | "dynamic": True, | 6010 | "dynamic": True, |
221 | 6011 | "type": "string", | ||
222 | 5996 | "for_grouping": True, | 6012 | "for_grouping": True, |
223 | 5997 | }, | 6013 | }, |
224 | 5998 | { | 6014 | { |
225 | 5999 | "key": "not_in_pool", | 6015 | "key": "not_in_pool", |
226 | 6000 | "label": "Not in resource pool", | 6016 | "label": "Not in resource pool", |
227 | 6001 | "dynamic": True, | 6017 | "dynamic": True, |
228 | 6018 | "type": "list[string]", | ||
229 | 6002 | "for_grouping": False, | 6019 | "for_grouping": False, |
230 | 6003 | }, | 6020 | }, |
231 | 6004 | { | 6021 | { |
232 | 6005 | "key": "storage", | 6022 | "key": "storage", |
233 | 6006 | "label": "Storage", | 6023 | "label": "Storage", |
234 | 6007 | "dynamic": True, | 6024 | "dynamic": True, |
235 | 6025 | "type": "string", | ||
236 | 6008 | "for_grouping": False, | 6026 | "for_grouping": False, |
237 | 6009 | }, | 6027 | }, |
238 | 6010 | { | 6028 | { |
239 | 6011 | "key": "interfaces", | 6029 | "key": "interfaces", |
240 | 6012 | "label": "Interfaces", | 6030 | "label": "Interfaces", |
241 | 6013 | "dynamic": True, | 6031 | "dynamic": True, |
242 | 6032 | "type": "dict[string,string]", | ||
243 | 6014 | "for_grouping": False, | 6033 | "for_grouping": False, |
244 | 6015 | }, | 6034 | }, |
245 | 6016 | { | 6035 | { |
246 | 6017 | "key": "devices", | 6036 | "key": "devices", |
247 | 6018 | "label": "Devices", | 6037 | "label": "Devices", |
248 | 6019 | "dynamic": True, | 6038 | "dynamic": True, |
249 | 6039 | "type": "string", | ||
250 | 6020 | "for_grouping": False, | 6040 | "for_grouping": False, |
251 | 6021 | }, | 6041 | }, |
252 | 6022 | { | 6042 | { |
253 | 6023 | "key": "cpu_count", | 6043 | "key": "cpu_count", |
254 | 6024 | "label": "CPU count", | 6044 | "label": "CPU count", |
255 | 6025 | "dynamic": True, | 6045 | "dynamic": True, |
256 | 6046 | "type": "float", | ||
257 | 6026 | "for_grouping": False, | 6047 | "for_grouping": False, |
258 | 6027 | }, | 6048 | }, |
259 | 6028 | { | 6049 | { |
260 | 6029 | "key": "mem", | 6050 | "key": "mem", |
261 | 6030 | "label": "Memory", | 6051 | "label": "Memory", |
262 | 6031 | "dynamic": True, | 6052 | "dynamic": True, |
263 | 6053 | "type": "float", | ||
264 | 6032 | "for_grouping": False, | 6054 | "for_grouping": False, |
265 | 6033 | }, | 6055 | }, |
266 | 6034 | { | 6056 | { |
267 | 6035 | "key": "pod", | 6057 | "key": "pod", |
268 | 6036 | "label": "The name of the desired pod", | 6058 | "label": "The name of the desired pod", |
269 | 6037 | "dynamic": True, | 6059 | "dynamic": True, |
270 | 6060 | "type": "string", | ||
271 | 6038 | "for_grouping": True, | 6061 | "for_grouping": True, |
272 | 6039 | }, | 6062 | }, |
273 | 6040 | { | 6063 | { |
274 | 6041 | "key": "not_pod", | 6064 | "key": "not_pod", |
275 | 6042 | "label": "The name of the undesired pod", | 6065 | "label": "The name of the undesired pod", |
276 | 6043 | "dynamic": True, | 6066 | "dynamic": True, |
277 | 6067 | "type": "string", | ||
278 | 6044 | "for_grouping": False, | 6068 | "for_grouping": False, |
279 | 6045 | }, | 6069 | }, |
280 | 6046 | { | 6070 | { |
281 | 6047 | "key": "pod_type", | 6071 | "key": "pod_type", |
282 | 6048 | "label": "The power_type of the desired pod", | 6072 | "label": "The power_type of the desired pod", |
283 | 6049 | "dynamic": False, | 6073 | "dynamic": False, |
284 | 6074 | "type": "string", | ||
285 | 6050 | "for_grouping": True, | 6075 | "for_grouping": True, |
286 | 6051 | }, | 6076 | }, |
287 | 6052 | { | 6077 | { |
288 | 6053 | "key": "not_pod_type", | 6078 | "key": "not_pod_type", |
289 | 6054 | "label": "The power_type of the undesired pod", | 6079 | "label": "The power_type of the undesired pod", |
290 | 6055 | "dynamic": False, | 6080 | "dynamic": False, |
291 | 6081 | "type": "string", | ||
292 | 6056 | "for_grouping": False, | 6082 | "for_grouping": False, |
293 | 6057 | }, | 6083 | }, |
294 | 6058 | { | 6084 | { |
295 | 6059 | "key": "hostname", | 6085 | "key": "hostname", |
296 | 6060 | "label": "Hostnames to filter on", | 6086 | "label": "Hostnames to filter on", |
297 | 6061 | "dynamic": True, | 6087 | "dynamic": True, |
298 | 6088 | "type": "list[string]", | ||
299 | 6062 | "for_grouping": False, | 6089 | "for_grouping": False, |
300 | 6063 | }, | 6090 | }, |
301 | 6064 | { | 6091 | { |
302 | 6065 | "key": "mac_address", | 6092 | "key": "mac_address", |
303 | 6066 | "label": "MAC addresses to filter on", | 6093 | "label": "MAC addresses to filter on", |
304 | 6067 | "dynamic": True, | 6094 | "dynamic": True, |
305 | 6095 | "type": "list[string]", | ||
306 | 6068 | "for_grouping": False, | 6096 | "for_grouping": False, |
307 | 6069 | }, | 6097 | }, |
308 | 6070 | { | 6098 | { |
309 | 6071 | "key": "domain", | 6099 | "key": "domain", |
310 | 6072 | "label": "Domain names to filter on", | 6100 | "label": "Domain names to filter on", |
311 | 6073 | "dynamic": True, | 6101 | "dynamic": True, |
312 | 6102 | "type": "list[string]", | ||
313 | 6074 | "for_grouping": True, | 6103 | "for_grouping": True, |
314 | 6075 | }, | 6104 | }, |
315 | 6076 | { | 6105 | { |
316 | 6077 | "key": "agent_name", | 6106 | "key": "agent_name", |
317 | 6078 | "label": "Only include nodes with events matching the agent name", | 6107 | "label": "Only include nodes with events matching the agent name", |
318 | 6079 | "dynamic": True, | 6108 | "dynamic": True, |
319 | 6109 | "type": "string", | ||
320 | 6080 | "for_grouping": False, | 6110 | "for_grouping": False, |
321 | 6081 | }, | 6111 | }, |
322 | 6082 | { | 6112 | { |
323 | 6083 | "key": "status", | 6113 | "key": "status", |
324 | 6084 | "label": "Only includes nodes with the specified status", | 6114 | "label": "Only includes nodes with the specified status", |
325 | 6085 | "dynamic": False, | 6115 | "dynamic": False, |
326 | 6116 | "type": "int", | ||
327 | 6086 | "for_grouping": True, | 6117 | "for_grouping": True, |
328 | 6087 | }, | 6118 | }, |
329 | 6088 | { | 6119 | { |
330 | @@ -6090,12 +6121,14 @@ class TestMachineHandlerFilter(MAASServerTestCase): | |||
331 | 6090 | "label": "Owner", | 6121 | "label": "Owner", |
332 | 6091 | "dynamic": True, | 6122 | "dynamic": True, |
333 | 6092 | "for_grouping": True, | 6123 | "for_grouping": True, |
334 | 6124 | "type": "string", | ||
335 | 6093 | }, | 6125 | }, |
336 | 6094 | { | 6126 | { |
337 | 6095 | "key": "power_state", | 6127 | "key": "power_state", |
338 | 6096 | "label": "Power State", | 6128 | "label": "Power State", |
339 | 6097 | "dynamic": False, | 6129 | "dynamic": False, |
340 | 6098 | "for_grouping": True, | 6130 | "for_grouping": True, |
341 | 6131 | "type": "int", | ||
342 | 6099 | }, | 6132 | }, |
343 | 6100 | ], | 6133 | ], |
344 | 6101 | handler.filter_groups({}), | 6134 | handler.filter_groups({}), |
UNIT TESTS type_to_ filter_ groups lp:~cgrabowski/maas/+git/maas into -b master lp:~maas-committers/maas
-b add_field_
STATUS: FAILED maas-ci. internal: 8080/job/ maas-tester/ 2/consoleText 289bb589c189b0f 805078119e
LOG: http://
COMMIT: 094eb6d1ead7d3a