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

https://docs.pyinfra.com/en/2.x/inventory-data.html should mention pyinfra.host.groups #1086

Open
drewp opened this issue Apr 21, 2024 · 0 comments

Comments

@drewp
Copy link

drewp commented Apr 21, 2024

Reading https://docs.pyinfra.com/en/2.x/inventory-data.html I didn't see any way to access the set of groups that a host is in. Printing dir(pyinfra.host) didn't help, since it looks like this:

['annotations', 'class', 'delattr', 'dict', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getstate', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'weakref', '_check_state', 'check_can_rsync', 'connect', 'connected', 'connection', 'create_fact', 'current_deploy_data', 'current_deploy_kwargs', 'current_deploy_name', 'current_op_hash', 'delete_fact', 'deploy', 'disconnect', 'executing_op_hash', 'get_deploy_data', 'get_fact', 'get_file', 'group_data', 'host_data', 'in_deploy', 'in_op', 'loop', 'nested_executing_op_hash', 'noop', 'print_prefix', 'put_file', 'reload_fact', 'rsync', 'run_shell_command', 'style_print_prefix']

Finally, code search showed me that there is a pyinfra.host.groups: list[str]. I suggest putting that in the doc page I was reading, if not also making a real pyinfra.host.groups attribute that can be discovered more easily.

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

No branches or pull requests

1 participant