bsdci / libioc

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

require exact match or trailing / when finding source datasets #570

Closed gronke closed 5 years ago

gronke commented 5 years ago

fixes #569

When a secondary iocage datasets name began with a name that is a prefix of another dataset, the first touched was resolved to be matching a resource selected by dataset name.

$ sysrc ioc_dataset_one="zroot/iocage"
$ sysrc ioc_dataset_two="zroot/iocage2"

Before

>>> import iocage
>>> host = iocage.Host()
>>> host.datasets.find_root_datasets("zroot/iocage2/foo").root.name
'zroot/iocage'

Detected dataset: 'zroot/iocage' (one)

After

>>> import iocage
>>> host = iocage.Host()
>>> host.datasets.find_root_datasets("zroot/iocage2/foo").root.name
'zroot/iocage2'

Detected dataset: 'zroot/iocage2' (two)