Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
feng-j678 committed Sep 26, 2024
1 parent ac4e9d8 commit fce2f30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/core/src/package_managers/YumPackageManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def get_security_updates(self):
"""Get missing security updates"""
self.composite_logger.log("\nDiscovering 'security' packages...")

if not self.__is_image_rhel8_higher():
if not self.__is_image_rhel8_or_higher():
self.install_yum_security_prerequisite()

out = self.invoke_package_manager(self.yum_check_security)
Expand Down Expand Up @@ -179,8 +179,8 @@ def get_other_updates(self):
self.composite_logger.log("Discovered " + str(len(other_packages)) + " 'other' package entries.")
return other_packages, other_package_versions

def __is_image_rhel8_higher(self):
""" Check if image is RHEL8+ set true else false """
def __is_image_rhel8_or_higher(self):
""" Check if image is RHEL8+ return true else false """
if self.env_layer.platform.linux_distribution() is not None:
os_offer, os_version, os_code = self.env_layer.platform.linux_distribution()

Expand Down
2 changes: 1 addition & 1 deletion src/core/tests/Test_YumPackageManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ def test_obsolete_packages_should_not_considered_in_available_updates(self):
self.assertTrue(available_updates[0] == "grub2-tools.x86_64")
self.assertTrue(package_versions[0] == "1:2.02-142.el8")

def test_rhel8_image_lower_with_security_plugin(self):
def test_rhel7_image_with_security_plugin(self):
"""Unit test for yum package manager rhel images below 8 and Classification = Security"""
# mock linux_distribution
backup_envlayer_platform_linux_distribution = LegacyEnvLayerExtensions.LegacyPlatform.linux_distribution
Expand Down

0 comments on commit fce2f30

Please sign in to comment.