Skip to content
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

feat: Add support for translanting %pre and main body part of kickstart #294

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

skycastlelily
Copy link
Contributor

No description provided.

@skycastlelily
Copy link
Contributor Author

This merge request is needed for adding support kickstart in tmt mrack plugin:)

Copy link
Contributor

@pvoborni pvoborni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just quickly read the code, providing initial comment.

I'm thinking that it might be good to cover this functionality with more unit tests as now it only tests only part of the new scenario.

Mrack's documentation kinda sucks. But this feature is not very obvious and thus I'm thinking that some docs might help. Somewhere in https://github.com/neoave/mrack/tree/main/docs/guides

src/mrack/transformers/beaker.py Outdated Show resolved Hide resolved
@skycastlelily
Copy link
Contributor Author

skycastlelily commented Jul 2, 2024 via email

@skycastlelily
Copy link
Contributor Author

skycastlelily commented Jul 2, 2024 via email

@skycastlelily
Copy link
Contributor Author

skycastlelily commented Jul 2, 2024 via email

@skycastlelily
Copy link
Contributor Author

yes,that is desired output, beaker is able to translate more than one %post section:)

Hi @pvoborni ,please feel free to tell me if you have any other concerns:)

@dav-pascual dav-pascual self-requested a review July 11, 2024 10:52
@dav-pascual
Copy link
Member

yes,that is desired output, beaker is able to translate more than one %post section:)

Hi @pvoborni ,please feel free to tell me if you have any other concerns:)

@skycastlelily He is OOO right now, so I will handle the review :)

@skycastlelily
Copy link
Contributor Author

skycastlelily commented Jul 12, 2024 via email

@dav-pascual
Copy link
Member

dav-pascual commented Jul 12, 2024

Hi @skycastlelily! In principle, changes LGTM
But before approving, please fix the test failures first FileNotFoundError: [Errno 2] No such file or directory: 'key_two'. You will probably need to mock that part.
You can run pytest in your local env installing the deps from test-requirements.txt

@skycastlelily
Copy link
Contributor Author

You will probably need to mock that part.

you mean mock _allow_ssh_keys ?By that way we won't be able to check whether _allow_ssh_keys works well or not, I have updated the test case to resolve the issue you mentioned, please feel free to tell me if that way is not expected.

You can run pytest in your local env installing the deps from test-requirements.txt

Thanks for your info,gonna to check:)

@skycastlelily
Copy link
Contributor Author

Updated again,should be good now:)Please note,the original doesn't work well,as it omits a comma after "\n".join(res_ks_append) ,as a result the job submit will have lots of <ks_append></ks_append><ks_append> lines

@dav-pascual
Copy link
Member

dav-pascual commented Jul 15, 2024

You will probably need to mock that part.

you mean mock _allow_ssh_keys ?By that way we won't be able to check whether _allow_ssh_keys works well or not, I have updated the test case to resolve the issue you mentioned, please feel free to tell me if that way is not expected.

I had in mind something like a '@/patch' mock style for the open file call, but this works too.

Updated again,should be good now:)Please note,the original doesn't work well,as it omits a comma after "\n".join(res_ks_append) ,as a result the job submit will have lots of <ks_append></ks_append><ks_append> lines

I'm not sure I have understood this lastest change. As far as I know, adding a comma to the list doesn't make any difference. What was wrong before that now it is not? And why is it necessary to sort the ssh keys?

@skycastlelily
Copy link
Contributor Author

I'm not sure I have understood this lastest change. As far as I know, adding a comma to the list doesn't make any
difference. What was wrong before that now it is not?

The comma is there because this line will make the ks_append string to a long list whose elements containing only one letter. This mr is good without that comma because I have brackets the strings with [], or we will get a job like this one

And why is it necessary to sort the ssh keys?

To make the test pass:)Set is unordered, key_two's content may be printed before key_one's.

@dav-pascual
Copy link
Member

@skycastlelily Great, thanks for the changes. Let's merge!

@dav-pascual dav-pascual merged commit feeae04 into neoave:main Jul 16, 2024
14 checks passed
@skycastlelily
Copy link
Contributor Author

skycastlelily commented Jul 16, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants