Skip to content

Commit

Permalink
update ioc_json.py - fix location changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Defenso-QTH committed Sep 22, 2024
1 parent cba0d6f commit 1e17127
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions iocage_lib/ioc_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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)
Expand Down

0 comments on commit 1e17127

Please sign in to comment.