-
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-09-19 14:31:42 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
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
7efbab0
to
03d4236
Compare
03d4236
to
387b031
Compare
387b031
to
b0d383b
Compare
/kickstart-test image-deployment-2 |
/kickstart-test image-deployment-2 |
/kickstart-test --skip-testtypes whatever |
I wonder if we can (as a follow-up, not requiring in scope of this PR) add some kickstart tests testing the scripts. In general, post and pre would be perhaps well tested by existing tests as they are using them heavily, but we may want to test also
|
/kickstart-test --testtype smoke |
The tests are failing.
|
I was also wondering if we should pass failing (erroronfail) script via return values and handle / raise in client rather then via dbus error / exception. But I am not deep enough in the matter to be able to give reasons. |
b0d383b
to
a7facef
Compare
a7facef
to
1e5d0aa
Compare
/kickstart-test --testtype smoke |
1e5d0aa
to
6648dff
Compare
6648dff
to
f8719ac
Compare
Working with: #5775
Thanks @rvykydal.