Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Move up check for empty jail to fix issue 512 (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsegaert authored and Brandon Schneider committed Apr 26, 2018
1 parent 1d23d7f commit 7a6c0f0
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions iocage/lib/ioc_create.py
Expand Up @@ -371,7 +371,15 @@ def _create_jail(self, jail_uuid, location):

final_line = f"{etc_hosts_ip_addr}\t{jail_hostname}\n"

if not self.clone:
if self.empty:
open(f"{location}/fstab", "wb").close()

config["release"] = "EMPTY"
config["cloned_release"] = "EMPTY"

iocjson.json_write(config)

elif not self.clone:
open(f"{location}/fstab", "wb").close()

with open(f"{location}/root/etc/hosts", "r") as _etc_hosts:
Expand Down Expand Up @@ -441,12 +449,6 @@ def _create_jail(self, jail_uuid, location):

iocjson.json_write(config)

if self.empty:
config["release"] = "EMPTY"
config["cloned_release"] = "EMPTY"

iocjson.json_write(config)

if not self.plugin:
if self.clone:
msg = f"{jail_uuid} successfully cloned!"
Expand Down

0 comments on commit 7a6c0f0

Please sign in to comment.