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

Adding multiple packages, installed_packages instead of just 1 #123

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions opl/generators/inventory_ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def _mid(self, data):
return data["subscription_manager_id"]

def _data(self):

packages_generated = self.pg.generate(self.packages)
data = {
"inventory_id": self._get_uuid(),
"subscription_manager_id": self._get_uuid(),
Expand All @@ -92,17 +94,7 @@ def _data(self):
]
),
"operating_system": json.dumps(self._get_operating_system()),
"installed_packages": json.dumps(
[
random.choice(
[
"krb5-libs-0:-1.16.1-23.fc29.i686",
"arb5-libs-0:-1.16.1-23.fc29.i686",
"brb5-libs-0:-1.16.1-23.fc29.i686",
]
)
]
),
"installed_packages": json.dumps(packages_generated),
"tuned_profile": random.choice(["desktop", "example", "laptop"]),
"selinux_current_mode": random.choice(
["enforcing", "permissive", "disabled"]
Expand Down Expand Up @@ -152,7 +144,7 @@ def _data(self):
"fqdn": self._get_hostname(),
"nowz": self._get_now_iso_z(), # well, this is in nano-seconds, but should be in mili-seconds
"tommorowz": self._get_tommorow_iso_z(),
"packages": self.pg.generate(self.packages),
"packages": packages_generated,
"yum_repos": opl.generators.packages.YumReposGenerator().generate(137),
"enabled_services": opl.generators.packages.EnabledServicesGenerator().generate(
139
Expand Down
Loading