Skip to content

Commit

Permalink
update ioc_start.py - improve log
Browse files Browse the repository at this point in the history
  • Loading branch information
Defenso-QTH committed Oct 3, 2024
1 parent 9203972 commit 650e056
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions iocage_lib/ioc_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def __start_jail__(self):
silent=self.silent)

jailed = self.is_jailed()
msg = f"* Jailed: {jailed and 'yes' or 'no'}"
msg = f" + Jailed: {jailed and 'yes' or 'no'}"
iocage_lib.ioc_common.logit({
"level": "INFO",
"message": msg
Expand All @@ -536,7 +536,7 @@ def __start_jail__(self):
)
elif jailed:
manual_devfs_config = False
configured_devfs_ruleset = None
configured_devfs_ruleset = conf['devfs_ruleset']
devfs_ruleset = 0
else:
# Generate dynamic devfs ruleset from configured one
Expand Down Expand Up @@ -733,12 +733,18 @@ def __start_jail__(self):
_callback=self.callback,
silent=self.silent)

if jailed and configured_devfs_ruleset != '0':
devfs_comment = ('(ignored configuration value "'
f'{configured_devfs_ruleset}": we are in a jail)')
elif manual_devfs_config:
devfs_comment = ('(cloned from devfs_ruleset '
f'{configured_devfs_ruleset})')
else:
devfs_comment = '(iocage generated default)'
iocage_lib.ioc_common.logit({
'level': 'INFO',
'message': f' + Using devfs_ruleset: {devfs_ruleset}'
+ (' (cloned from devfs_ruleset '
f'{configured_devfs_ruleset})' if manual_devfs_config
else ' (iocage generated default)')
f' {devfs_comment}'
},
_callback=self.callback,
silent=self.silent)
Expand Down

0 comments on commit 650e056

Please sign in to comment.