Skip to content

Commit

Permalink
Merge pull request #31 from freenas/ticket-43119
Browse files Browse the repository at this point in the history
Potential Bug fix for jail creation
  • Loading branch information
sonicaj committed Sep 13, 2018
2 parents 5c757ec + ba7738b commit 4852ea6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion iocage_lib/ioc_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,11 @@ def _create_jail(self, jail_uuid, location):
elif not self.clone:
open(f"{location}/fstab", "wb").close()

with open(f"{location}/root/etc/hosts", "r") as _etc_hosts:
with open(
f"{self.iocroot}/"
f"{'releases' if not self.template else 'templates'}/"
f"{self.release}/root/etc/hosts", "r"
) as _etc_hosts:
with iocage_lib.ioc_common.open_atomic(
f"{location}/root/etc/hosts", "w") as etc_hosts:
# open_atomic will empty the file, we need these still.
Expand Down

0 comments on commit 4852ea6

Please sign in to comment.