Commit 4c37812
authored
AAP-50805 Ignore role content types not known to system in sync (ansible#811)
The bug here is that AWX `periodic_resource_sync` will result in an
error.
It seems there was an attempt to log an error and continue on when
getting a `ValidationError`, it seems this only targeted the Django
validation error exception, leaving the more common DRF ValidationError
uncaught. This means that the issue broke the resource sync, globally.
That means the periodic sync was effectively broken by the referenced
bug.
We could change that, but we wanted to have a targeted and more
intentional special-case just for roles, and that is what this
implements.
If the field `RoleDefinition.content_type` references a type that does
not exist locally, we don't bother in the _periodic fallback_ sync and
just skip over that record. This is very sensible behavior, and it will
be reported as a no-op, as one should expect.1 parent a22e139 commit 4c37812
File tree
3 files changed
+55
-2
lines changed- ansible_base/resource_registry
- tasks
- test_app/tests/resource_registry
3 files changed
+55
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
| |||
226 | 233 | | |
227 | 234 | | |
228 | 235 | | |
| 236 | + | |
| 237 | + | |
229 | 238 | | |
230 | 239 | | |
231 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
181 | 212 | | |
182 | 213 | | |
183 | 214 | | |
| |||
0 commit comments