-
Notifications
You must be signed in to change notification settings - Fork 353
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
base: master
Are you sure you want to change the base?
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-10-02 14:03:14 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
a7facef
to
1e5d0aa
Compare
/kickstart-test --testtype smoke |
1e5d0aa
to
6648dff
Compare
6648dff
to
f8719ac
Compare
f8719ac
to
4958c2f
Compare
4958c2f
to
01d0de6
Compare
01d0de6
to
67cdc61
Compare
/kickstart-test --kstest-pr 1302 --skip-testtypes whatever |
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 much better. However, I don't almost any tests.
You are adding a new Task and a new module and none of these are covered by tests. Please take a look on test coverage to see what is missing.
67cdc61
to
a26706c
Compare
a26706c
to
320ae7f
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
Working with: #5775
Thanks @rvykydal.