-
Notifications
You must be signed in to change notification settings - Fork 11
Default Config #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default Config #35
Conversation
5ce788f
to
0ff3cad
Compare
libiocage/cli/start.py
Outdated
@@ -51,6 +51,7 @@ def cli(ctx, rc, jails, log_level): | |||
try: | |||
jail.start() | |||
except Exception: | |||
raise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exit(1)
will never be reached.
# if self.data["jail_zfs"] does not explicitly exist, _get_jail_zfs | ||
# would raise | ||
# if self.data["jail_zfs"] does not explicitly exist, | ||
# _get_jail_zfs would raise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this a docstring, two comments at the top look ugly
except: | ||
pass | ||
|
||
# if it was not, the default for is 'nullfs' if the jail is a basejail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it was not, the default for a basejail type is nullfs
reads better
libiocage/lib/JailConfigJSON.py
Outdated
@@ -24,7 +24,9 @@ def read(self): | |||
|
|||
def read_data(self): | |||
with open(JailConfigJSON.__get_config_json_path(self), "r") as conf: | |||
return json.load(conf) | |||
data = json.load(conf) | |||
conf.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The with
statement already closes once you leave it, that shouldn't be necessary.
def __init__(self, config_type, *args, **kwargs): | ||
msg = f"Could not read {config_type} config" | ||
# This is a silent error internally used | ||
Exception.__init__(self, msg, *args, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't correct, __init__
only accepts *args
and **kwargs
. If we ever used this internally, it wouldn't function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a problem here - right. But we're seeing different ones here. I would have removed *args, **kwargs
from Exception.init, because we only want to raise this message and nothing else.
a737e39
to
9d36222
Compare
9d36222
to
e8f7767
Compare
e8f7767
to
e1f4a91
Compare
e1f4a91
to
bcc75c7
Compare
implements #26
<ACTIVE_POOL>/iocage
Additional Changes