diff options
author | Christian Breunig <christian@breunig.cc> | 2023-04-01 14:42:45 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2023-04-01 14:44:51 +0200 |
commit | 39c8d271b388588905e2a0584fafe180b2c76d9a (patch) | |
tree | 4405e95922127f00517d1174681f2f723c1ae86d /src | |
parent | 6f81d7ab1fe3f7ae794dd2b1d55533890b0db6a9 (diff) | |
download | vyos-1x-39c8d271b388588905e2a0584fafe180b2c76d9a.tar.gz vyos-1x-39c8d271b388588905e2a0584fafe180b2c76d9a.zip |
container: T5047: bugfix TypeError: argument of type 'NoneType' is not iterable
Commit 52e51ffb ("container: T5047: restart only containers that changed")
started to iterate over a NoneType which is invalid. This happened when a
network description was changed but no container was due for restart.
(cherry picked from commit 86d7b8d1d2b53b9fa93bd456abb4ea1b4f2949b6)
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/container.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/conf_mode/container.py b/src/conf_mode/container.py index 53e577310..50c3424d2 100755 --- a/src/conf_mode/container.py +++ b/src/conf_mode/container.py @@ -423,7 +423,8 @@ def apply(container): os.unlink(file_path) continue - if name in dict_search('container_restart', container): + tmp = dict_search('container_restart', container) + if tmp and name in tmp: cmd(f'systemctl restart vyos-container-{name}.service') if disabled_new: |