Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions azurelinuxagent/common/osutil/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ def _get_osutil(distro_name, distro_code_name, distro_version, distro_full_name)
if distro_name == "uos":
return RedhatOSUtil()

if distro_name == "anolis":
return RedhatOSUtil()

if distro_name == "freebsd":
return FreeBSDOSUtil()

Expand Down
3 changes: 3 additions & 0 deletions azurelinuxagent/common/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ def get_distro():
if os.path.exists("/etc/UnionTech-release"):
osinfo[0] = "uos"

if os.path.exists("/etc/anolis-release"):
osinfo[0] = "anolis"

if os.path.exists("/etc/mariner-release"):
osinfo[0] = "mariner"

Expand Down
7 changes: 7 additions & 0 deletions tests/common/osutil/test_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ def test_get_osutil_it_should_return_uos(self):
self.assertTrue(isinstance(ret, RedhatOSUtil))
self.assertEqual(ret.get_service_name(), "waagent")

def test_get_osutil_it_should_return_anolis(self):
ret = _get_osutil(distro_name="anolis",
distro_code_name="",
distro_version="",
distro_full_name="")
self.assertTrue(isinstance(ret, RedhatOSUtil))
self.assertEqual(ret.get_service_name(), "waagent")

def test_get_osutil_it_should_return_freebsd(self):
ret = _get_osutil(distro_name="freebsd",
Expand Down