-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add _translate_constraint_by_config function #2967
base: main
Are you sure you want to change the base?
Conversation
This MR looks at config file and tries to find a "translation" that would match the constraint, operator, value, and if found, it'd take it from configuration,we will need this to translate some complex or containing-internal-information constrains :) |
85a52d6
to
f650833
Compare
yeah,it will be used if any _transform_*_*_ function calls
_translate_constraint_by_config,should I move this function to a new merge
request?^^
…On Mon, Jun 3, 2024 at 5:01 PM Miloš Prchlík ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In tmt/steps/provision/mrack.py
<#2967 (comment)>:
> @@ -197,6 +202,34 @@ class MrackHWNotGroup(MrackHWGroup):
name: str = 'not'
+def _get_custom_config() -> dict[str, Any]:
This function does not seem to be called from anywhere.
—
Reply to this email directly, view it on GitHub
<#2967 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKFR23EQLS4CPESTI3BWEEDZFQWFPAVCNFSM6AAAAABIOH3ASGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDAOJTGI2DANZYGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Updated^^ |
e454788
to
648b9f9
Compare
648b9f9
to
1a89ca3
Compare
1a89ca3
to
f0e0636
Compare
tmt/steps/provision/mrack.py
Outdated
if not hardware_config: | ||
return None | ||
|
||
return hardware_config.hardware_config |
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'd recommend returning an empty list, it's as false-ish as
None
- is it necessary to capture there exceptions, and then either reraise, or silence it?
MetadataError
should be heard as loudly asSpecificationError
.
I think this could be simplified (plus "custom config" can mean anything, we're speaking about "translations" of constraints directly to Beaker XML):
def _get_constraint_translations() -> list[Translate]:
config = tmt.config.Config()
return config.hardware.translations if config.hardware else []
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.
is it necessary to capture there exceptions, and then either reraise, or silence it? MetadataError should be heard as loudly as SpecificationError
We don't want to raise an error if there is no config tree,right ? so ,they should be handled differently.WDYT? :)
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.
Aha, I forgot it's still raising MetadataError
- it will not if my https://github.com/teemtee/tmt/pull/3519/files#diff-c4acf376ac31d8918aa707c285892dd693fe71005eb4412bbfa4eb1273511f71R94 gets merged.
f0e0636
to
d4222f6
Compare
Thanks for your super quick response,and pretty valuable suggestions, updated accordingly^^ |
d4222f6
to
3ac72a4
Compare
Adding |
Pull Request Checklist