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

Add FreeBSD operations & facts #1246

Open
wants to merge 7 commits into
base: 3.x
Choose a base branch
from
Open

Add FreeBSD operations & facts #1246

wants to merge 7 commits into from

Conversation

DtxdF
Copy link

@DtxdF DtxdF commented Nov 26, 2024

No description provided.

@DtxdF
Copy link
Author

DtxdF commented Nov 26, 2024

fixed!

Copy link
Member

@Fizzadar Fizzadar left a comment

Choose a reason for hiding this comment

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

Hi @DtxdF! Thank you for the PR, this looks great! Would it be possible to add some tests for the operations? (plenty of examples here: https://github.com/pyinfra-dev/pyinfra/tree/3.x/tests/operations).

@@ -0,0 +1,12 @@
# This file only exists to support:
Copy link
Member

Choose a reason for hiding this comment

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

I really like the use of a submodule for all the freebsd operations, neat.

@DtxdF
Copy link
Author

DtxdF commented Jan 17, 2025

Hi @DtxdF! Thank you for the PR, this looks great! Would it be possible to add some tests for the operations? (plenty of examples here: https://github.com/pyinfra-dev/pyinfra/tree/3.x/tests/operations).

Finally I have a time.

I have seen the logic in both tests/operations and tests/facts but how can I test them on my system?

@Fizzadar
Copy link
Member

I have seen the logic in both tests/operations and tests/facts but how can I test them on my system?

There's a script scripts/dev-test.sh that runs them or you can use pytest directly. The contributing guide has complete instructions!

@0EVSG
Copy link

0EVSG commented Feb 9, 2025

Nice to see this. @DtxdF, contact me if you're interested in getting this into the FreeBSD port early, or maybe even taking maintainership of the port - I'm currently lacking time to invest more into side projects like this.

* Change `tests/test_operations.py` to accept freebsd operations
  - Fix `ValueError: too many values to unpack (expected 2)`
* Simplify fact `freebsd.ServiceScript`.
* Add missing parameter `jail` in `freebsd.pkg` operation.
* Change Enum to simple "constants" in `freebsd.sysrc` and `freebsd.service`
  to use strings instead of the properties to make the tests work and to use
  those operations from the CLI.
* Change the `state` argument to `srvstate` in `freebsd.service.service`
  to avoid conflicts with `pyinfra_cli/util.py:load_func` when invoking
  the operation from the CLI.
@DtxdF
Copy link
Author

DtxdF commented Feb 11, 2025

Nice to see this. @DtxdF, contact me if you're interested in getting this into the FreeBSD port early, or maybe even taking maintainership of the port - I'm currently lacking time to invest more into side projects like this.

Great! I will send you a patch in Bugzilla! Thanks!

@DtxdF
Copy link
Author

DtxdF commented Feb 11, 2025

I have seen the logic in both tests/operations and tests/facts but how can I test them on my system?

There's a script scripts/dev-test.sh that runs them or you can use pytest directly. The contributing guide has complete instructions!

Thank you! The tests are already with some changes, let me know if everything goes well!

@DtxdF
Copy link
Author

DtxdF commented Feb 26, 2025

@Fizzadar

Are you ok with this PR or do I need to do something else? I am very anxious to migrate from Ansible to Pyinfra :D

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