Commit b7f0277
committed
juju_utils: fix assumptions about 'subordinate-to'
Few places in the code made assumption that for subordinate charms,
the 'subordinate-to' list would contain only principal charms. However
that is not the case. If a suboridnate charm is related to other
subordinate charms, they show up in each other's 'subordinate-to' lists.
This was especially problematic in the 'get_machines_for_application'
function which would end up in an infinite loop.
(cherry picked from commit a361300)
Signed-off-by: Martin Kalcok <martin.kalcok@canonical.com>1 parent 1fc5a8a commit b7f0277
File tree
4 files changed
+77
-9
lines changed- unit_tests
- utilities
- zaza
- utilities
4 files changed
+77
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
251 | 252 | | |
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
255 | 275 | | |
256 | 276 | | |
257 | 277 | | |
258 | 278 | | |
259 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
260 | 284 | | |
261 | 285 | | |
262 | 286 | | |
263 | 287 | | |
264 | 288 | | |
265 | 289 | | |
266 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
267 | 294 | | |
268 | 295 | | |
269 | 296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
85 | 99 | | |
86 | 100 | | |
87 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
88 | 106 | | |
89 | 107 | | |
90 | 108 | | |
91 | 109 | | |
92 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
93 | 114 | | |
94 | 115 | | |
95 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
2573 | 2574 | | |
2574 | 2575 | | |
2575 | 2576 | | |
2576 | | - | |
2577 | | - | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
2578 | 2585 | | |
2579 | 2586 | | |
2580 | 2587 | | |
| |||
2585 | 2592 | | |
2586 | 2593 | | |
2587 | 2594 | | |
2588 | | - | |
| 2595 | + | |
| 2596 | + | |
2589 | 2597 | | |
2590 | 2598 | | |
2591 | 2599 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
| |||
142 | 147 | | |
143 | 148 | | |
144 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
145 | 157 | | |
146 | | - | |
| 158 | + | |
147 | 159 | | |
148 | 160 | | |
149 | 161 | | |
| |||
0 commit comments