diff options
| author | Quentin Young <qlyoung@nvidia.com> | 2021-11-12 13:37:09 -0500 |
|---|---|---|
| committer | Quentin Young <qlyoung@nvidia.com> | 2021-11-12 13:37:09 -0500 |
| commit | 6e09a5bfea74197658f04f0becd2700969432707 (patch) | |
| tree | 95e5e65542b842bd638b85125cef6da9ea0eb5d3 /tools/frr-reload.py | |
| parent | d2863e4a6b55ffd698445e1a692752350c8d6de7 (diff) | |
tools: simplify excessively complex conditional
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
Diffstat (limited to 'tools/frr-reload.py')
| -rwxr-xr-x | tools/frr-reload.py | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py index 435a0fbc25..8762b956b6 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -1329,19 +1329,22 @@ def ignore_unconfigurable_lines(lines_to_add, lines_to_del): for (ctx_keys, line) in lines_to_del: - if ( - ctx_keys[0].startswith("frr version") - or ctx_keys[0].startswith("frr defaults") - or ctx_keys[0].startswith("username") - or ctx_keys[0].startswith("password") - or ctx_keys[0].startswith("line vty") - or - # This is technically "no"able but if we did so frr-reload would - # stop working so do not let the user shoot themselves in the foot - # by removing this. - ctx_keys[0].startswith("service integrated-vtysh-config") + # The integrated-vtysh-config one is technically "no"able but if we did + # so frr-reload would stop working so do not let the user shoot + # themselves in the foot by removing this. + if any( + [ + ctx_keys[0].startswith(x) + for x in [ + "frr version", + "frr defaults", + "username", + "password", + "line vty", + "service integrated-vtysh-config", + ] + ] ): - log.info('"%s" cannot be removed' % (ctx_keys[-1],)) lines_to_del_to_del.append((ctx_keys, line)) |
