-
Notifications
You must be signed in to change notification settings - Fork 355
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
Migrate the kickstart script commands #5739
Migrate the kickstart script commands #5739
Conversation
Hello @adamkankovsky! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2024-11-07 14:02:38 UTC |
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.
Otherwise looks good to me so far.
scriptsdir = $(pkgpyexecdir)/modules/runtime/scripts | ||
dist_scripts_DATA = $(wildcard $(srcdir)/*.py) | ||
|
||
MAINTAINERCLEANFILES = Makefile.in |
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.
MAINTAINERCLEANFILES = Makefile.in | |
MAINTAINERCLEANFILES = Makefile.in | |
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.
Add missing newline at the end of the file.
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
pkgpyexecdir = $(pyexecdir)/py$(PACKAGE_NAME) | ||
scriptsdir = $(pkgpyexecdir)/modules/runtime/scripts |
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 have a feeling that his will not work correctly. There is already scriptsdir variable (scripts/Makefile.am
) and I have a feeling these are global. I'm not 100% sure how ti behaves so please make sure that your commit won't break automake and both directories are processed correctly by automake.
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.
So far everything works as it should and there is no problem with the module
I'll just add link to my WIP before @adamkankovsky took over: #5775, may be useful for reference. (I used Katerina's WIP in the same way). |
c13788b
to
b039904
Compare
b039904
to
2956709
Compare
2956709
to
d7507b4
Compare
d7507b4
to
d5d17d6
Compare
d5d17d6
to
305d912
Compare
305d912
to
42c0b63
Compare
/kickstart-test --testtype smoke |
42c0b63
to
1c4f683
Compare
/kickstart-test --testtype smoke |
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.
Looks great otherwise.
Also please take a look on coverage. I'm surprised that for such a change we don't have any new tests.
pyanaconda/core/kickstart/scripts.py
Outdated
execution. | ||
Output is logged by the program logger, the path specified by --log | ||
or to /tmp/ks-script-\\*.log | ||
# TODORV return |
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 guess this is leftover.
pyanaconda/core/kickstart/scripts.py
Outdated
@@ -0,0 +1,80 @@ | |||
# | |||
# Commond utilities for working with scripts |
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.
Commond
is typo?
self.scripts = [] | ||
|
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.
Why is this required?
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.
Yes, because sections for scripts don't have a data parser like packages does, and sections themselves don't have an action to create an array for scitps. Therefore it is necessary to create it manually. It looks quite strange, but I spent a lot of time on this parsing and unfortunately I didn't come up with anything better using pykickstart
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.
Could you please add comment explaining this?
for script in self._scripts: | ||
if script.type == self._script_type: | ||
if script.type == KS_SCRIPT_POST: | ||
script.run(conf.target.system_root) |
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 I'm reading this correctly then you are saying that post script is always run in chroot. That is not correct it depends on --nochroot
parameter.
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 is only the path which is used if --chroot is set. Default is always "/".
__all__ = ["ScriptsModule"] | ||
|
||
|
||
class RunScriptsTask(Task): |
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.
Please separate this class into another file.
1c4f683
to
3184a63
Compare
3184a63
to
46062e2
Compare
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.
Looks great to me now. Thanks!
320ae7f
to
e81a0b7
Compare
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.
Please add test case for testing that the scripts different sections persist in the generated kickstart.
e81a0b7
to
bd91620
Compare
bd91620
to
d30e646
Compare
d30e646
to
486b519
Compare
486b519
to
d13a207
Compare
/kickstart-test --kstest-pr 1302 --skip-testtypes whatever |
/kickstart-test --kstest-pr 1302 --skip-testtypes whatever |
/kickstart-tests --testtype ksscript |
d13a207
to
9a13d14
Compare
/kickstart-tests --testtype ksscript |
1 similar comment
/kickstart-tests --testtype ksscript |
9a13d14
to
63395ca
Compare
/kickstart-tests --testtype ksscript |
/kickstart-tests --testtype smoke |
Working with: #5775
Thanks @rvykydal.