Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add anolis support #2656

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
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