Skip to content

Commit

Permalink
Replace Kickstart add_packages/add_packages_group with append
Browse files Browse the repository at this point in the history
  • Loading branch information
mildas authored and comps committed Aug 6, 2024
1 parent 5d1c88b commit 0542fe5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion hardening/anaconda/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
ks = virt.translate_ssg_kickstart(profile)

if os.environ.get('USE_SERVER_WITH_GUI'):
ks.add_package_group('Server with GUI')
ks.packages.append('@Server with GUI')

# host a HTTP server with a datastream and let the guest download it
with util.BackgroundHTTPServer(virt.NETWORK_HOST, 0) as srv:
Expand Down
2 changes: 1 addition & 1 deletion hardening/ansible/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
if not g.can_be_snapshotted():
ks = virt.Kickstart(partitions=partitions.partitions)
if use_gui:
ks.add_package_group('Server with GUI')
ks.packages.append('@Server with GUI')
g.install(kickstart=ks)
g.prepare_for_snapshot()

Expand Down
2 changes: 1 addition & 1 deletion hardening/oscap/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
if not g.can_be_snapshotted():
ks = virt.Kickstart(partitions=partitions.partitions)
if use_gui:
ks.add_package_group('Server with GUI')
ks.packages.append('@Server with GUI')
g.install(kickstart=ks)
g.prepare_for_snapshot()

Expand Down
8 changes: 1 addition & 7 deletions lib/virt.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,6 @@ def add_post(self, content):
'set -xe; exec >/dev/tty 2>&1\n' + content + '\n%end')
self.append(new)

def add_packages(self, pkgs):
self.packages += pkgs

def add_package_group(self, group):
self.packages.append(f'@{group}')

def add_install_only_repo(self, name, baseurl):
self.appends.append(f'repo --name={name} --baseurl={baseurl}')

Expand Down Expand Up @@ -435,7 +429,7 @@ def install(self, location=None, kickstart=None, rpmpack=None, disk_format='raw'
'contest-rpmpack',
f'http://{http_host}:{http_port}/repo',
)
kickstart.add_packages([util.RpmPack.NAME])
kickstart.packages.append(util.RpmPack.NAME)

ksfile = stack.enter_context(kickstart.to_tmpfile())

Expand Down

0 comments on commit 0542fe5

Please sign in to comment.