Commit 58bc720
dnsmasq: Fix start_v[4|6] is None
The task[1] has started to fail recently
on following error: "object of type
'NoneType' has no len(). object of type
'NoneType' has no len()"
I can see that cifmw_dnsmasq_network_definition in my case is:
name: osp_trunk
original_name: cifmw-osp_trunk
ranges:
- label: osp_trunk
options:
- option:dns-server,192.168.122.1
- option:router
prefix_length_v4: 24
prefix_length_v6: null
start_v4: 192.168.122.2
start_v6: null
Which means that start_v6 is None and
that's defined but of NoneType so length
filter can't be used on it. The filter
does not need to be used tho It's enough
to condition, i.e. "if variable" (instead of
"If variable | length > 0") which
would be false if values is None, false,
0, empty string, dictionary or list.
[1] https://github.com/openstack-k8s-operators/ci-framework/blob/main/roles/dnsmasq/tasks/manage_network.yml#L351 parent 06bfb9d commit 58bc720
3 files changed
Lines changed: 9 additions & 9 deletions
File tree
- roles
- config_drive/tasks
- dnsmasq/templates
- libvirt_manager/tasks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
0 commit comments