-
Notifications
You must be signed in to change notification settings - Fork 669
Resume/abort #4036
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
base: master
Are you sure you want to change the base?
Resume/abort #4036
Conversation
|
Well holy crap that was fast 😅 |
|
Comes from a fork so this is passage 2. Also my logic was bad your pre-commit checks help a lot |
|
I'll mark this as ready as the logic looks sound and feels correct on testing branch |
|
Thoughts on this one @svartkanin? :) (Aside from having to move it to the new TUI in #3997) |
archinstall/lib/configuration.py
Outdated
|
|
||
| def has_saved_config() -> bool: | ||
| """Check if there's a saved config in /var/log/archinstall""" | ||
| config_file = logger.directory / 'user_configuration.json' |
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 file names are defined here
| self._user_config_file = Path('user_configuration.json') |
| from archinstall.tui.types import Alignment | ||
|
|
||
|
|
||
| def _check_for_saved_config() -> None: |
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 we want this feature it should be usable in all the provided scripts that ship, so this should go into a generic file so it can be re-used by any script.
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.
I think it only makes sense for guided ? I integrated it to the Class and renamed as you asked
that already makes it re-usable. There are also safeguards for silent and check that this only happens in --debug
Altho it does change the exit behavior slightly with an extra Abort / Cancel which isn't necessarily a bad thing
archinstall/lib/configuration.py
Outdated
| config_output.save(dest_path, creds=True, password=enc_password) | ||
|
|
||
|
|
||
| def has_saved_config() -> bool: |
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.
Can we move these into the ConfigurationOutput class and Maybe rename that thing to ConfigurationHandler it will make future refactoring much easier
|
In addition to the comments, I can see some benefits for it but also it's not fully self-contained for regular users as the If the intention with this is to "be easier during dev" I'd suggest to put this behind the |
I agree, skipping credentials is good and if that's the only step when re-running it still save time. And putting it behind |
Integrate resume behind --debug flag - With --debug: "Save selections and abort", "Abort without saving", "Cancel" - Without --debug: "Abort", "Cancel"
h8d13
left a comment
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.
Address feedback rounds from torxed/svart
| from archinstall.tui.types import Alignment | ||
|
|
||
|
|
||
| def _check_for_saved_config() -> None: |
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.
I think it only makes sense for guided ? I integrated it to the Class and renamed as you asked
that already makes it re-usable. There are also safeguards for silent and check that this only happens in --debug
Altho it does change the exit behavior slightly with an extra Abort / Cancel which isn't necessarily a bad thing
#4035 draft (comes from my dev fork)
This would be especially good for testing ;)