Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8934338
Initial Commit for rhel10
yashnap Jun 8, 2026
75fa11e
Rhel 10 changes
yashnap Jun 11, 2026
c5828f5
Merge remote-tracking branch 'origin/master' into dnf4_package_manage…
yashnap Jun 25, 2026
2675eff
Changes
yashnap Jun 26, 2026
2b7a745
Dnf4 changes
yashnap Jul 1, 2026
dc345b8
Merge branch 'master' into dnf4_package_manager_rhel10
yashnap Jul 1, 2026
19a86f7
Copilot comments
yashnap Jul 1, 2026
a5b9564
Address Code review #1
yashnap Jul 2, 2026
a1c418b
Added UT for missing method
yashnap Jul 2, 2026
4be3cbd
Merge branch 'master' into dnf4_package_manager_rhel10
yashnap Jul 21, 2026
a7dba17
Address code Review
yashnap Jul 21, 2026
61627d4
Address code review. renaming file to have DNF
yashnap Jul 27, 2026
51143e3
Remove stale variable reference
yashnap Jul 27, 2026
b3a331c
Merge branch 'master' into dnf4_package_manager_rhel10
yashnap Aug 4, 2026
3efa978
Address code review
yashnap Aug 5, 2026
0770a2e
Merge branch 'master' into dnf4_package_manager_rhel10
yashnap Aug 5, 2026
c648f9e
Merge branch 'master' into dnf4_package_manager_rhel10
yashnap Aug 5, 2026
4149007
Coverage fix
yashnap Aug 5, 2026
bd153e4
Merge branch 'master' into dnf4_package_manager_rhel10
yashnap Aug 7, 2026
ae5b7d7
Merge branch 'master' into dnf4_package_manager_rhel10
yashnap Aug 7, 2026
029f67c
Address code review
yashnap Aug 7, 2026
39ebb10
Increase sleep time
yashnap Aug 10, 2026
98b7ede
Address code review
yashnap Aug 12, 2026
3b259ec
Address code review
yashnap Aug 18, 2026
b35d0c0
Merge branch 'master' into dnf4_package_manager_rhel10
yashnap Sep 2, 2026
99f21c7
Address Code review
yashnap Sep 2, 2026
940cada
Update command
yashnap Sep 2, 2026
5509481
Address Code review + UT covergae
yashnap Sep 2, 2026
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
6 changes: 5 additions & 1 deletion src/core/src/bootstrap/ConfigurationFactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

from core.src.package_managers.AptitudePackageManager import AptitudePackageManager
from core.src.package_managers.AzL3TdnfPackageManager import AzL3TdnfPackageManager
from core.src.package_managers.Dnf4PackageManager import Dnf4PackageManager
from core.src.package_managers.Dnf5PackageManager import Dnf5PackageManager
from core.src.package_managers.YumPackageManager import YumPackageManager
from core.src.package_managers.ZypperPackageManager import ZypperPackageManager
Expand Down Expand Up @@ -71,18 +72,21 @@ def __init__(self, log_file_path, events_folder, telemetry_supported):

self.configurations = {
'apt_prod_config': self.new_prod_configuration(Constants.APT, AptitudePackageManager),
'dnf4_prod_config': self.new_prod_configuration(Constants.DNF4, Dnf4PackageManager),
Comment thread
michellemcdaniel marked this conversation as resolved.
Outdated
'dnf5_prod_config': self.new_prod_configuration(Constants.DNF5, Dnf5PackageManager),
'tdnf_prod_config': self.new_prod_configuration(Constants.TDNF, AzL3TdnfPackageManager),
'yum_prod_config': self.new_prod_configuration(Constants.YUM, YumPackageManager),
'zypper_prod_config': self.new_prod_configuration(Constants.ZYPPER, ZypperPackageManager),

'apt_dev_config': self.new_dev_configuration(Constants.APT, AptitudePackageManager),
'dnf4_dev_config': self.new_prod_configuration(Constants.DNF4, Dnf4PackageManager),
'dnf5_dev_config': self.new_dev_configuration(Constants.DNF5, Dnf5PackageManager),
'tdnf_dev_config': self.new_dev_configuration(Constants.TDNF, AzL3TdnfPackageManager),
'yum_dev_config': self.new_dev_configuration(Constants.YUM, YumPackageManager),
'zypper_dev_config': self.new_dev_configuration(Constants.ZYPPER, ZypperPackageManager),

'apt_test_config': self.new_test_configuration(Constants.APT, AptitudePackageManager),
'dnf4_test_config': self.new_prod_configuration(Constants.DNF4, Dnf4PackageManager),
'dnf5_test_config': self.new_test_configuration(Constants.DNF5, Dnf5PackageManager),
'tdnf_test_config': self.new_test_configuration(Constants.TDNF, AzL3TdnfPackageManager),
'yum_test_config': self.new_test_configuration(Constants.YUM, YumPackageManager),
Expand Down Expand Up @@ -120,7 +124,7 @@ def get_configuration(self, env, package_manager_name):
print ("Error: Environment configuration not supported - " + str(env))
return None

if str(package_manager_name) not in [Constants.APT, Constants.DNF5, Constants.TDNF, Constants.YUM, Constants.ZYPPER]:
if str(package_manager_name) not in [Constants.APT, Constants.DNF4, Constants.DNF5, Constants.TDNF, Constants.YUM, Constants.ZYPPER]:
print ("Error: Package manager configuration not supported - " + str(package_manager_name))
return None

Expand Down
1 change: 1 addition & 0 deletions src/core/src/bootstrap/Constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ class StatusTruncationConfig(EnumBackport):

# Package Managers
APT = 'apt'
DNF4 = 'dnf4'
DNF5 = 'dnf5'
TDNF = 'tdnf'
YUM = 'yum'
Expand Down
27 changes: 25 additions & 2 deletions src/core/src/bootstrap/EnvLayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,21 @@ def is_distro_rhel_10(self, distro_name):
""" Checks if the current distro is RHEL 10 """
return self.__is_matching_distro_and_version(distro_name, Constants.RED_HAT, version_to_match=10)

def __is_dnf_available(self):
code, _ = self.run_command_output('which dnf', False, False)
return code == 0

def __get_dnf_version(self):
code, out = self.run_command_output('dnf --version', False, False)
# Output : dnf5 version 5.2.18.0/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the / at the end of this comment intended?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, earlier I had dnf5 version 5.2.18.0/4.20.0 but updated later. Removed / from the end

# Output : 4.20.0
if code != 0 or not out:
return code, out, None

first_line = str(out).splitlines()[0].strip()
version = first_line.split()[-1]
return code, out, version

def get_package_manager(self):
# type: () -> str
""" Detects package manager type """
Expand All @@ -93,8 +108,16 @@ def get_package_manager(self):

# Check for unsupported distros

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update comment. Rhel10 no longer unsupported.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

if self.is_distro_rhel_10(os_name):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be expanded backwards later if shown to be stable (RHEL 9 for e.g.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the method to a generic name and added comment for future when we plan to expand. Right now, the is_distro_rhel method only checks for version 10 but we can update the version in future.

error_msg = "This distro is not yet supported in your region. Please review https://aka.ms/VMGuestPatchingCompatibility for more information. [Distro={0}][Version={1}][Code={2}]".format(str(os_name), os_version, os_code)
print("Error: {0}".format(error_msg))
if not self.__is_dnf_available():
print("Error: Expected package manager dnf not found on this rhel 10 VM.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer if you matched the original error message formatting.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RHEL in caps always

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return str()
code, out, version = self.__get_dnf_version()
if version:
if version.startswith('4'):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment here on the dnf5 PR. Also, I think we may want to split the version comparison into a separate function rather than having a lot of duplicate code. Something like a shared "check_major_version" function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this

return Constants.DNF4
print("Error: Expected dnf version 4 on this rhel 10 VM. Found: {0}".format(version))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return str()
print("Error: Unable to determine dnf version. Code={0}, Output={1}".format(code, out))
return str()

# Check for Azure Linux 4 or Above( uses dnf5)
Expand Down
Loading
Loading