Skip to content

Commit 88fa537

Browse files
committed
update distro name for ACL as azurecontainerlinux in waagent
Signed-off-by: Mayank Singh <mayankfz@gmail.com>
1 parent 08be6ef commit 88fa537

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

azurelinuxagent/common/osutil/factory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ def _get_osutil(distro_name, distro_code_name, distro_version, distro_full_name)
149149

150150
# distro_name is same for azurelinux/mariner and Azure Container Linux (ACL).
151151
# ACL is a flavor of Azure Linux, differentiation is based on distro_full_name.
152-
# For Azure Container Linux, distro_name is "azurelinux" and distro_full_name is "Microsoft Azure Container Linux".
153-
if distro_name == "azurelinux" and distro_full_name == "Microsoft Azure Container Linux":
152+
# For Azure Container Linux, distro_name will be made "azurecontainerlinux".
153+
if distro_name == "azurecontainerlinux":
154154
return AclOSUtil()
155155

156156
if distro_name in ["mariner", "azurelinux"]:

azurelinuxagent/common/version.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ def get_distro():
137137
if os.path.exists("/etc/mariner-release"):
138138
osinfo[0] = "mariner"
139139

140+
if os.path.exists("/etc/os-release"):
141+
try:
142+
with open("/etc/os-release", "r") as f:
143+
if re.search(r'^VARIANT_ID=azurecontainerlinux$', f.read(), re.MULTILINE):
144+
osinfo[0] = "azurecontainerlinux"
145+
except Exception:
146+
pass
147+
140148
# The platform.py lib has issue with detecting BIG-IP linux distribution.
141149
# Merge the following patch provided by F5.
142150
if os.path.exists("/shared/vadc"):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def get_data_files(name, version, fullname): # pylint: disable=R0912
164164
src=["config/clearlinux/waagent.conf"])
165165
set_systemd_files(data_files, dest=systemd_dir_path,
166166
src=["init/clearlinux/waagent.service"])
167-
elif name == 'azurelinux' and fullname == "Microsoft Azure Container Linux":
167+
elif name == 'azurecontainerlinux':
168168
set_bin_files(data_files, dest=agent_bin_path)
169169
set_logrotate_files(data_files)
170170
set_conf_files(data_files, dest="/etc",

tests/common/osutil/test_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def test_get_osutil_it_should_return_coreos(self):
160160
self.assertEqual(ret.get_service_name(), "waagent")
161161

162162
def test_get_osutil_it_should_return_acl(self):
163-
ret = _get_osutil(distro_name="azurelinux",
163+
ret = _get_osutil(distro_name="azurecontainerlinux",
164164
distro_code_name="",
165165
distro_version="3.0",
166166
distro_full_name="Microsoft Azure Container Linux")

0 commit comments

Comments
 (0)