Skip to content

Commit

Permalink
update ioc_json.py - fix location logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Defenso-QTH committed Sep 23, 2024
1 parent 8861228 commit 1bb539c
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions iocage_lib/ioc_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -1868,18 +1868,17 @@ def json_set_value(self, prop, _import=False, default=False):

conf["type"] = "template"

self.location = new_location.lstrip(
if self.zpool.prefix == '':
self.location = new_location.lstrip(self.pool)
else:
self.location = new_location.lstrip(
os.path.join(self.zpool.name, self.zpool.prefix)
).replace(
)
self.location = self.location.replace(
"/iocage", self.iocroot
)
print('new_location=', new_location)
print('lstrip=', new_location.lstrip(
os.path.join(self.zpool.name, self.zpool.prefix)
)
)
print('iocroot=', self.iocroot)
print('location=', self.location)
print('location=', location)

iocage_lib.ioc_common.logit(
{
Expand All @@ -1901,12 +1900,16 @@ 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(
if self.zpool.prefix == '':
self.location = old_location.lstrip(self.pool)
else:
self.location = old_location.lstrip(
os.path.join(self.zpool.name, self.zpool.prefix)
).replace(
)
self.location = self.location.replace(
"/iocage", self.iocroot
)
print('location 1903=', self.location)
print('location 1912=', self.location)
ds.set_property('readonly', 'off')

self.json_check_prop(key, value, conf, default)
Expand Down

0 comments on commit 1bb539c

Please sign in to comment.