Skip to content

Commit 66767af

Browse files
author
Mayank Singh
committed
Reapply "update distro name to match os-release"
This reverts commit 198ad10.
1 parent 198ad10 commit 66767af

8 files changed

Lines changed: 12 additions & 13 deletions

File tree

azurelinuxagent/common/osutil/acl.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@ def conf_sshd(self, disable_password):
4747
snippet_file = os.path.join(snippet_dir, "80-acl-walinuxagent.conf")
4848
option = "no" if disable_password else "yes"
4949
lines = [
50-
f"PasswordAuthentication {option}",
51-
f"ChallengeResponseAuthentication {option}",
52-
f"ClientAliveInterval {str(conf.get_ssh_client_alive_interval())}"
50+
"PasswordAuthentication {0}".format(option),
51+
"ChallengeResponseAuthentication {0}".format(option),
52+
"ClientAliveInterval {0}".format(conf.get_ssh_client_alive_interval())
5353
]
5454
fileutil.write_file(snippet_file, "\n".join(lines))
5555
logger.info("Added SSH config snippet {0} for ACL".format(snippet_file))
5656
else:
5757
# If snippets are unavailable, fall back to base behavior (ensuring file is not a symlink).
5858
conf_file_path = conf.get_sshd_conf_file_path()
59-
conf_file_path2 = f"{conf_file_path}.wal.tmp"
59+
conf_file_path2 = "{0}.wal.tmp".format(conf_file_path)
6060
shutil.copy(conf_file_path, conf_file_path2)
6161
os.remove(conf_file_path)
6262
os.rename(conf_file_path2, conf_file_path)
63-
super(CoreosCommonUtil, self).conf_sshd(disable_password)
63+
super(AclUtil, self).conf_sshd(disable_password)
6464

6565
def restart_if(self, ifname, retries=3, wait=5):
6666
"""

azurelinuxagent/common/osutil/coreos.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#
1818

1919
import os
20-
from azurelinuxagent.common.utils import shellutil
2120
from azurelinuxagent.common.osutil.coreoscommon import CoreosCommonUtil
2221

2322

azurelinuxagent/common/osutil/coreoscommon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def is_dhcp_enabled(self):
3232
def start_network(self):
3333
return shellutil.run("systemctl start systemd-networkd", chk_err=False)
3434

35-
def restart_if(self, ifname=None, retries=None, wait=None):
35+
def restart_if(self, ifname, retries=3, wait=5):
3636
shellutil.run("systemctl restart systemd-networkd")
3737

3838
def restart_ssh_service(self):

azurelinuxagent/common/osutil/factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def _get_osutil(distro_name, distro_code_name, distro_version, distro_full_name)
9090
if distro_name == "kali":
9191
return DebianOSBaseUtil()
9292

93-
if distro_name in ("acl") or distro_code_name in ("acl"):
93+
if distro_name in ("azurecontainerlinux",) or distro_code_name in ("azurecontainerlinux",):
9494
return AclUtil()
9595

9696
if distro_name in ("flatcar", "coreos") or distro_code_name in ("flatcar", "coreos"):

azurelinuxagent/pa/deprovision/factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def get_deprovision_handler(distro_name=DISTRO_NAME,
3535
return Ubuntu1804DeprovisionHandler()
3636
else:
3737
return UbuntuDeprovisionHandler()
38-
if distro_name in ("acl", "flatcar", "coreos"):
38+
if distro_name in ("azurecontainerlinux", "flatcar", "coreos"):
3939
return CoreOSDeprovisionHandler()
4040
if "Clear Linux" in distro_full_name:
4141
return ClearLinuxDeprovisionHandler() # pylint: disable=E1120

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ def get_data_files(name, version, fullname): # pylint: disable=R0912
150150
set_udev_files(data_files)
151151
set_systemd_files(data_files, dest=systemd_dir_path,
152152
src=["init/arch/waagent.service"])
153-
elif name in ('coreos', 'flatcar', 'acl'):
153+
elif name in ('coreos', 'flatcar', 'azurecontainerlinux'):
154154
set_bin_files(data_files, dest=agent_bin_path)
155155
set_logrotate_files(data_files)
156-
if name == 'acl':
156+
if name == 'azurecontainerlinux':
157157
set_conf_files(data_files, dest="/etc",
158158
src=["config/acl/waagent.conf"])
159159
set_systemd_files(data_files, dest=systemd_dir_path,

tests/common/osutil/test_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def test_get_osutil_it_should_return_coreos(self):
158158
distro_full_name="")
159159
self.assertTrue(isinstance(ret, CoreOSUtil))
160160
self.assertEqual(ret.get_service_name(), "waagent")
161-
ret = _get_osutil(distro_name="acl",
161+
ret = _get_osutil(distro_name="azurecontainerlinux",
162162
distro_code_name="",
163163
distro_version="",
164164
distro_full_name="")

tests/lib/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def load_bin_data(name, directory=None):
492492

493493
["coreos", "", ""],
494494
["flatcar", "", ""],
495-
["acl", "", ""],
495+
["azurecontainerlinux", "", ""],
496496

497497
["suse", "12", "SUSE Linux Enterprise Server"],
498498
["suse", "13.2", "openSUSE"],

0 commit comments

Comments
 (0)