Last active
February 11, 2022 16:21
-
-
Save jturel/317e9f892fb19e84480880f1f674e74e to your computer and use it in GitHub Desktop.
SubscriptionFacetPools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a new organization $MYORG | |
org = Organization.find_by_name($MYORG) | |
hosts = [] | |
50000.times { hosts << { name: SecureRandom.uuid, organization_id: org.id } } | |
host_ids = ::Host::Managed.import(hosts, validate: false).ids | |
facets = host_ids.map { |id| { host_id: id } } | |
facet_ids = Katello::Host::SubscriptionFacet.import(facets, validate: false).ids | |
pool = Katello::Pool.create!(cp_id: SecureRandom.uuid, organization: org) | |
facet_pools = facet_ids.map { |facet_id| { pool_id: pool.id, subscription_facet_id: facet_id } } | |
Katello::SubscriptionFacetPool.import(facet_pools, validate: false) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment