Page MenuHomeVyOS Platform

Improve `utils.convert.convert_data()` to process all stdtypes
Closed, ResolvedPublicFEATURE REQUEST

Description

Currently, convert_data() works for str, bytes, list, and OrderedDict. This can lead to potentially dangerous situations when wrong data is nested inside other unsupported types and passed without conversion or if it has one of not supported types and is silently dropped by convert_data().

https://github.com/vyos/vyos-1x/blob/b76f103317b5aa8abdee5c942509fc11f9e20ef3/python/vyos/utils/convert.py#L147

We should improve conversion to support at least all stdtypes (and subclasses as a result).

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Improvement (missing useful functionality)