diff options
author | Daniil Baturin <daniil@vyos.io> | 2022-10-28 11:04:51 -0400 |
---|---|---|
committer | Daniil Baturin <daniil@vyos.io> | 2022-10-28 11:04:51 -0400 |
commit | fca46598415f0c6f11c272d6b384ac98500fd69d (patch) | |
tree | 09820fb7f804967eff453d3df73d4a72a2cf933a /python/vyos/opmode.py | |
parent | ea8d4ae325059681460f6c74751cfe8ebb2931bc (diff) | |
download | vyos-1x-fca46598415f0c6f11c272d6b384ac98500fd69d.tar.gz vyos-1x-fca46598415f0c6f11c272d6b384ac98500fd69d.zip |
T4765: handle non-string fields in the raw op mode output normalizer
Diffstat (limited to 'python/vyos/opmode.py')
-rw-r--r-- | python/vyos/opmode.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/python/vyos/opmode.py b/python/vyos/opmode.py index c9827d634..727e118a8 100644 --- a/python/vyos/opmode.py +++ b/python/vyos/opmode.py @@ -101,6 +101,10 @@ def _get_arg_type(t): return t def _normalize_field_name(name): + # Convert the name to string if it is not + # (in some cases they may be numbers) + name = str(name) + # Replace all separators with underscores name = re.sub(r'(\s|[\(\)\[\]\{\}\-\.\,:\"\'\`])+', '_', name) |