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

Commit

Permalink
Add IOCAGE_SKIP environment variable
Browse files Browse the repository at this point in the history
This allows you to skip the dataset check
  • Loading branch information
Brandon Schneider committed Dec 20, 2017
1 parent 53e3fcc commit b6905b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions iocage/lib/ioc_json.py
Expand Up @@ -513,6 +513,19 @@ def json_get_value(self, prop, default=False):
"activate with iocage activate "
"POOL")

if os.environ["IOCAGE_SKIP"] == "TRUE":
iocage.lib.ioc_common.logit(
{
"level":
"EXCEPTION",
"message":
"IOCAGE_SKIP is TRUE or an RC operation, not"
" activating a pool.\nPlease manually issue"
" iocage activate POOL"
},
_callback=self.callback,
silent=self.silent)

iocage.lib.ioc_common.logit(
{
"level":
Expand Down
3 changes: 3 additions & 0 deletions iocage/main.py
Expand Up @@ -200,6 +200,7 @@ def cli(version, force):
"""A jail manager."""
IOCLogger()
skip_check = False
os.environ["IOCAGE_SKIP"] = "FALSE"
skip_check_cmds = ["--help", "activate", "-v", "--version", "--rc"]

try:
Expand All @@ -213,10 +214,12 @@ def cli(version, force):

for arg in sys.argv[1:]:
if arg in skip_check_cmds:
os.environ["IOCAGE_SKIP"] = "TRUE"
skip_check = True
elif "clean" in arg:
skip_check = True
os.environ["IOCAGE_FORCE"] = "TRUE"
os.environ["IOCAGE_SKIP"] = "TRUE"
ioc_check.IOCCheck(silent=True)

if not skip_check:
Expand Down

0 comments on commit b6905b2

Please sign in to comment.