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 Broker.multi_manager #215

Merged
merged 1 commit into from
May 25, 2023

Conversation

JacobCallahan
Copy link
Member

This change introduces a way to carry out multiple kinds of checkouts at the same time when using Broker as a library.

from the docstring:

        Given a mapping of names to Broker argument dictionaries:
        create multiple Broker instances, check them out in parallel, yield, then checkin.
        Example:
            with Broker.multi_mode(
                rhel7={
                    "host_class": ContentHost,
                    "workflow": "deploy_base_rhel",
                    "deploy_rhel_version": "7",
                },
                rhel8={
                    "host_class": ContentHost,
                    "workflow": "deploy_base_rhel",
                    "deploy_rhel_version": "8",
                }
            ) as host_dict:
                pass
        All are checked out at the same time. The user is presented with the hosts in
        a dictionary by argument name e.g. host_dict["rhel7"] is a ContentHost object

@JacobCallahan JacobCallahan added the enhancement New feature or request label May 22, 2023
@JacobCallahan
Copy link
Member Author

New functional test passing
Screenshot from 2023-05-22 15-30-06

@JacobCallahan
Copy link
Member Author

Now, there are some decisions that I'm not final on. Let me know what you all think about these?

  1. When there is a single host, as a value per key, separate it from the list.
  2. Perform all setup and teardown methods in a thread pool.

This change introduces a way to carry out multiple kinds of checkouts at
the same time when using Broker as a library.
@JacobCallahan
Copy link
Member Author

Ok, latest update also executes all host setup and teardown tasks in a thread pool

Copy link
Member

@ogajduse ogajduse left a comment

Choose a reason for hiding this comment

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

I like this feature. LGTM.
Great job, @JacobCallahan!

@JacobCallahan JacobCallahan merged commit be3e948 into SatelliteQE:master May 25, 2023
4 checks passed
@JacobCallahan JacobCallahan deleted the multi_manager branch May 25, 2023 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants