magma
magma copied to clipboard
chore: Clean up boolean arguments in fabfiles
Signed-off-by: Krisztián Varga [email protected]
Summary
In fabfiles the boolean arguments were not standardized. Calling a fabric function from the command line with a boolean argument will pass a string to it. This PR ensures that all of the public functions expect string-boolean values and only use them for conditions if they have been converted to boolean. This closes #14031.
Additionally, the distutils.util.strtobool
function will be deprecated in Python v3.10, therefore a new converter function was created. For more information see: https://peps.python.org/pep-0632/
Test Plan
CI.
Additional Information
- [ ] This change is backwards-breaking
Thanks for opening a PR! :100:
- All commits must be signed off. This is enforced by
DCO check
. - All PR titles must follow the semantic commits format. This is enforced by
Semantic PR
.
Howto
- Reviews. The "Reviewers" listed for this PR are the Magma maintainers who will shepherd it.
- Checks. All required CI checks must pass before merge.
-
Merge. Once approved and passing CI checks, use the
ready2merge
label to indicate the maintainers can merge your PR.
More info
Please take a moment to read through the Magma project's
- Contributing Conventions for norms around contributed code
If this is your first Magma PR, also consider reading
- Developer Onboarding for onboarding as a new Magma developer
- Development Workflow for guidance on your first pull request
- CI Checks for points of contact for failing or flaky CI checks
- GitHub-to-Slack mappings for Magma maintainers for guidance on how to contact maintainers on Slack
feg-workflow
2 files 203 suites 40s :stopwatch: 374 tests 374 :heavy_check_mark: 0 :zzz: 0 :x: 388 runs 388 :heavy_check_mark: 0 :zzz: 0 :x:
Results for commit 872cca51.
:recycle: This comment has been updated with latest results.
dp-workflow
14 tests 14 :heavy_check_mark: 2m 14s :stopwatch: 1 suites 0 :zzz: 1 files 0 :x:
Results for commit 872cca51.
:recycle: This comment has been updated with latest results.
agw-workflow
615 tests 611 :heavy_check_mark: 3m 43s :stopwatch: 2 suites 4 :zzz: 2 files 0 :x:
Results for commit 872cca51.
:recycle: This comment has been updated with latest results.
There is still the issue with clear_orc8r
and some other variables in lte/gateway/python/integ_tests/federated_tests/fabfile.py
. Those variables are not converted to booleans at the moment.
There is still the issue with
clear_orc8r
and some other variables inlte/gateway/python/integ_tests/federated_tests/fabfile.py
. Those variables are not converted to booleans at the moment.
Yes, I missed clear_orc8r
and the deletion of line 344, but I don't see anything else. All others are used as strings and/or converted to bool when needed.
Make it sense to replace strtobool
by another one maybe self-written, because the function is deprecated since Python 3.10 and will be deleted in 3.12. (PEP-0632)
Make it sense to replace
strtobool
by another one maybe self-written, because the function is deprecated since Python 3.10 and will be deleted in 3.12. (PEP-0632)
It will be available in the setuptools
package instead, can't we just use that one? IMO writing an existing function again is not the best solution.
Make it sense to replace
strtobool
by another one maybe self-written, because the function is deprecated since Python 3.10 and will be deleted in 3.12. (PEP-0632)It will be available in the
setuptools
package instead, can't we just use that one? IMO writing an existing function again is not the best solution.
I think strtobool
won't be moved there and they say "you will need to reimplement the functionality yourself" in the link. We might want to use an easier version of the function though. (In any case, it will only be a problem in Python 3.12 so it's optional in this PR. But we could already consider changing it to be future-proof.)
Make it sense to replace
strtobool
by another one maybe self-written, because the function is deprecated since Python 3.10 and will be deleted in 3.12. (PEP-0632)It will be available in the
setuptools
package instead, can't we just use that one? IMO writing an existing function again is not the best solution.I think
strtobool
won't be moved there and they say "you will need to reimplement the functionality yourself" in the link. We might want to use an easier version of the function though. (In any case, it will only be a problem in Python 3.12 so it's optional in this PR. But we could already consider changing it to be future-proof.)
I did not notice that this function was mentioned there by name. I will try to create something light to replace it.
Oops! Looks like you failed the Python Format Check
.
Howto
- Instructions on running the formatter and linter locally are provided in the format AGW doc
- Guide to the different CI checks and resolution guidelines
:recycle: Updated: :white_check_mark: The check is passing the Python Format Check after the last commit.
cloud-workflow
1 135 tests 1 135 :heavy_check_mark: 2m 15s :stopwatch: 365 suites 0 :zzz: 7 files 0 :x:
Results for commit 872cca51.
:recycle: This comment has been updated with latest results.
Oops! Looks like you failed the DCO check
. Be sure to sign all your commits.
Howto
- Magma guidelines on signing commits
-
About the
signoff
feature - Howto: sign-off most-recent commit
- Howto: sign-off multiple past commits
- Guide to the different CI checks and resolution guidelines
:recycle: Updated: :white_check_mark: The check is passing the DCO check after the last commit.