From 1e17127dab3aed89eabda1fb62beb6dd077a13a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20Th=C3=A9bault?= Date: Sun, 22 Sep 2024 22:53:17 +0900 Subject: [PATCH] update ioc_json.py - fix location changes --- iocage_lib/ioc_json.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/iocage_lib/ioc_json.py b/iocage_lib/ioc_json.py index d686fa3f..1090c3fa 100644 --- a/iocage_lib/ioc_json.py +++ b/iocage_lib/ioc_json.py @@ -1862,9 +1862,7 @@ def json_set_value(self, prop, _import=False, default=False): conf["type"] = "template" self.location = new_location.lstrip( - self.zpool.name - ).lstrip( - self.zpool.prefix + os.path.join(self.zpool.name, self.zpool.prefix) ).replace( "/iocage", self.iocroot ) @@ -1889,8 +1887,11 @@ def json_set_value(self, prop, _import=False, default=False): ds = Dataset(new_location) ds.rename(old_location, {'force_unmount': True}) conf["type"] = "jail" - self.location = old_location.lstrip(self.pool).replace( - "/iocage", self.iocroot) + self.location = old_location.lstrip( + os.path.join(self.zpool.name, self.zpool.prefix) + ).replace( + "/iocage", self.iocroot + ) ds.set_property('readonly', 'off') self.json_check_prop(key, value, conf, default)