Skip to content

Commit

Permalink
Update 03 according to comments from Milos and Petr
Browse files Browse the repository at this point in the history
* Added warning about the unsupported distro
* Added info about "Nothing to do on Fedora for EPEL"

Signed-off-by: Vector Li <[email protected]>
  • Loading branch information
idorax committed Aug 15, 2023
1 parent a3516c6 commit 70785c3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tmt/steps/prepare/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def enable(self, guest: Guest, logger: tmt.log.Logger) -> None:
sudo = 'sudo' if self.guest.facts.is_superuser is False else ''

if guest_distro == Distro.FEDORA:
self.info('Enable EPEL on Fedora, do nothing ...')
self.info('Nothing to do on Fedora for EPEL')
elif guest_distro == Distro.CENTOS_7:
# yum install epel-release
self.info('Enable EPEL on CentOS 7')
Expand Down Expand Up @@ -161,7 +161,7 @@ def enable(self, guest: Guest, logger: tmt.log.Logger) -> None:
shscript2 = ShellScript(f'{sudo} dnf -y install {" ".join(RHEL_9_PACKAGES)}')
self.guest.execute(shscript1 + shscript2, silent=True)
else:
pass
self.warn('The distro of the guest is not supported.')

def disable(self, guest: Guest, logger: tmt.log.Logger) -> None:
guest_distro = self.get_guest_distro(guest=guest, logger=logger)
Expand All @@ -171,8 +171,7 @@ def disable(self, guest: Guest, logger: tmt.log.Logger) -> None:
sudo = 'sudo' if self.guest.facts.is_superuser is False else ''

if guest_distro == Distro.FEDORA:
# XXX: What to do?
self.info('Disable epel on Fedora, do nothing ...')
self.info('Nothing to do on Fedora for EPEL')
elif guest_distro == Distro.RHEL_8:
# subscription-manager repos --disable codeready-builder-for-rhel-8-$(arch)-rpms
# dnf -y remove epel-release
Expand All @@ -188,7 +187,7 @@ def disable(self, guest: Guest, logger: tmt.log.Logger) -> None:
shscript2 = ShellScript(f'{sudo} dnf -y remove epel-release')
self.guest.execute(shscript1 + shscript2, silent=True)
else:
pass
self.warn('The distro of the guest is not supported.')


_FEATURES = {
Expand Down

0 comments on commit 70785c3

Please sign in to comment.