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:42:45 +0200 |
commit | 86d7b8d1d2b53b9fa93bd456abb4ea1b4f2949b6 (patch) | |
tree | 65bb9741a6a5c01a69c341eb98f8cdbe36069b59 /src/conf_mode/container.py | |
parent | 2265bb4dc27965da3dce7e3f476366b7d1e911f3 (diff) | |
download | vyos-1x-86d7b8d1d2b53b9fa93bd456abb4ea1b4f2949b6.tar.gz vyos-1x-86d7b8d1d2b53b9fa93bd456abb4ea1b4f2949b6.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.
Diffstat (limited to 'src/conf_mode/container.py')
-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 bf83416b2..4e4db7180 100755 --- a/src/conf_mode/container.py +++ b/src/conf_mode/container.py @@ -459,7 +459,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: |