From b47dc2c47ff125d644720b03f598a9caf4e08192 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Thu, 30 Jan 2020 18:55:38 +0500 Subject: [PATCH] Only update release property on update of jails This commit fixes an issue where iocage updated the complete configuration of jails on update for updating release property. This results in undesired behaviour with jails having partial configuration resulting in complete configuration and some properties are different when jail is running, i.e devfs_ruleset, that is changed as well. Closes #1130 --- iocage_lib/ioc_fetch.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/iocage_lib/ioc_fetch.py b/iocage_lib/ioc_fetch.py index 15f2a4769..c9e78465d 100644 --- a/iocage_lib/ioc_fetch.py +++ b/iocage_lib/ioc_fetch.py @@ -950,19 +950,16 @@ def fetch_update(self, cli=False, uuid=None): if not cli: for jail, path in jails.items(): - _json = iocage_lib.ioc_json.IOCJson(path) + _json = iocage_lib.ioc_json.IOCJson(path, cli=False) props = _json.json_get_value('all') if props['basejail'] and self.release.rsplit( '-', 1 )[0] in props['release']: - props['release'] = new_release - _json.json_write(props) + _json.json_set_value(f'release={new_release}') else: - _json = iocage_lib.ioc_json.IOCJson(jails[uuid]) - props = _json.json_get_value('all') - props['release'] = new_release - _json.json_write(props) + _json = iocage_lib.ioc_json.IOCJson(jails[uuid], cli=False) + _json.json_set_value(f'release={new_release}') if self.verify: # tmp only exists if they verify SSL certs