bsdci / libioc

A Python library to manage jails with ioc{age,ell}
https://bsd.ci/libioc
Other
38 stars 11 forks source link

existing data keys do not cause UnknownJailProperty when read #654

Closed gronke closed 5 years ago

gronke commented 5 years ago

Fixes an issue interfacing with legacy jails that have unsupported jail properties. When reading such values from jails that have loaded them from an existing configuration storage (json, zfs, ucl), no error is raised. This allows to unset such values and starting jails with existing, but unsupported JailConfig parameters.

gronke commented 5 years ago

This draft comes with the disadvantage of no warnings being printed when starting a jail with unknown properties. Either we have to double-check whether a unused property was found or the idea to assume existing keys of the JailConfig.data property are known was thought too simple.

gronke commented 5 years ago

Added a detection step for unused jail parameters in JailGenerator.start() that prints one warning for all unused JailConfig parameters found in an existing Jail on start.