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

Implementation of new conf flag AutoUpdate.UpdateToLatestVersion support #3027

Merged
merged 11 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions azurelinuxagent/common/agent_supported_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ def __init__(self):

class _GAVersioningGovernanceFeature(AgentSupportedFeature):
"""
CRP would drive the RSM upgrade version if agent reports that it does support RSM upgrades with this flag otherwise CRP fallback to largest version.
CRP would drive the RSM update if agent reports that it does support RSM upgrades with this flag otherwise CRP fallback to largest version.
Agent doesn't report supported feature flag if auto update is disabled or old version of agent running that doesn't understand GA versioning.

Note: Especially Windows need this flag to report to CRP that GA doesn't support the updates. So linux adopted same flag to have a common solution.
"""

__NAME = SupportedFeatureNames.GAVersioningGovernance
__VERSION = "1.0"
__SUPPORTED = conf.get_autoupdate_enabled()
__SUPPORTED = conf.get_auto_update_to_latest_version()

def __init__(self):
super(_GAVersioningGovernanceFeature, self).__init__(name=self.__NAME,
Expand Down
24 changes: 14 additions & 10 deletions azurelinuxagent/common/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def load_conf_from_file(conf_file_path, conf=__conf__):
"ResourceDisk.EnableSwap": False,
"ResourceDisk.EnableSwapEncryption": False,
"AutoUpdate.Enabled": True,
"AutoUpdate.UpdateToLatestVersion": True,
"EnableOverProvisioning": True,
#
# "Debug" options are experimental and may be removed in later
Expand All @@ -136,7 +137,6 @@ def load_conf_from_file(conf_file_path, conf=__conf__):
"Debug.CgroupLogMetrics": False,
"Debug.CgroupDisableOnProcessCheckFailure": True,
"Debug.CgroupDisableOnQuotaCheckFailure": True,
"Debug.DownloadNewAgents": True,
"Debug.EnableAgentMemoryUsageCheck": False,
"Debug.EnableFastTrack": True,
"Debug.EnableGAVersioning": True
Expand Down Expand Up @@ -475,8 +475,8 @@ def get_autoupdate_gafamily(conf=__conf__):
return conf.get("AutoUpdate.GAFamily", "Prod")


def get_autoupdate_enabled(conf=__conf__):
return conf.get_switch("AutoUpdate.Enabled", True)
def get_autoupdate_enabled(conf=__conf__, default=True):
Copy link
Member

Choose a reason for hiding this comment

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

callers of get_autoupdate_enabled should not be able to override the default.

the conf module is responsible for defining the defaults

return conf.get_switch("AutoUpdate.Enabled", default)


def get_autoupdate_frequency(conf=__conf__):
Expand All @@ -503,15 +503,19 @@ def get_monitor_network_configuration_changes(conf=__conf__):
return conf.get_switch("Monitor.NetworkConfigurationChanges", False)


def get_download_new_agents(conf=__conf__):
def get_auto_update_to_latest_version(conf=__conf__):
"""
If True, the agent go through update logic to look for new agents to download otherwise it will stop agent updates.
NOTE: AutoUpdate.Enabled controls whether the Agent downloads new update and also whether any downloaded updates are started or not, while DownloadNewAgents controls only the former.
AutoUpdate.Enabled == false -> Agent preinstalled on the image will process extensions and will not update (regardless of DownloadNewAgents flag)
AutoUpdate.Enabled == true and DownloadNewAgents == true, any update already downloaded will be started, and agent look for future updates
AutoUpdate.Enabled == true and DownloadNewAgents == false, any update already downloaded will be started, but the agent will not look for future updates
If set to True, agent will update to the latest version
Copy link
Member

Choose a reason for hiding this comment

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

we should add unit tests that codify these rules: use all combinations of y/n/absent for both flags and check the return value of UpdateToLatestVersion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed

NOTE:
when both turned on, both AutoUpdate.Enabled and AutoUpdate.UpdateToLatestVersion same meaning: update to latest version
when turned off, AutoUpdate.Enabled: reverts to pre-installed agent, AutoUpdate.UpdateToLatestVersion: uses latest version already installed on the vm and does not download new agents
Even we are deprecating AutoUpdate.Enabled, we still need to support if users explicitly setting it instead new flag.
If AutoUpdate.UpdateToLatestVersion is present, it overrides any value set for AutoUpdate.Enabled (if present).
If AutoUpdate.Enabled is present and set to 'n', we adhere to AutoUpdate.Enabled flag's behavior
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment here as other PR, lines 513 and 514 seem to contradict each other to me

if both not present, we default to True.
"""
return conf.get_switch("Debug.DownloadNewAgents", True)
default = get_autoupdate_enabled()
return conf.get_switch("AutoUpdate.UpdateToLatestVersion", default)


def get_cgroup_check_period(conf=__conf__):
Expand Down
4 changes: 2 additions & 2 deletions azurelinuxagent/ga/agent_update_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ def _get_agent_family_manifest(self, goal_state):
def run(self, goal_state, ext_gs_updated):

try:
# Ignore new agents if update is disabled. The latter flag only used in e2e tests.
if not conf.get_autoupdate_enabled() or not conf.get_download_new_agents():
# If auto update is disabled, we don't proceed with update
if not conf.get_auto_update_to_latest_version():
return

# Update the state only on new goal state
Expand Down
6 changes: 6 additions & 0 deletions azurelinuxagent/ga/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,12 @@ def log_if_agent_versioning_feature_disabled():
log_if_op_disabled("OS.EnableFirewall", conf.enable_firewall())
log_if_op_disabled("Extensions.Enabled", conf.get_extensions_enabled())
log_if_op_disabled("AutoUpdate.Enabled", conf.get_autoupdate_enabled())
log_if_op_disabled("AutoUpdate.UpdateToLatestVersion", conf.get_auto_update_to_latest_version())

if conf.get_autoupdate_enabled(default=None) is not None and conf.get_autoupdate_enabled() != conf.get_auto_update_to_latest_version():
msg = "AutoUpdate.Enabled property is **Deprecated** now but it's set to different value from AutoUpdate.UpdateToLatestVersion. Please consider removing it if added by mistake"
logger.warn(msg)
add_event(AGENT_NAME, op=WALAEventOperation.ConfigurationChange, message=msg)

if conf.enable_firewall():
log_if_int_changed_from_default("OS.EnableFirewallPeriod", conf.get_enable_firewall_period())
Expand Down
6 changes: 5 additions & 1 deletion config/alpine/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ OS.OpensslPath=None
OS.SshDir=/etc/ssh

# Enable or disable goal state processing auto-update, default is enabled
# AutoUpdate.Enabled=y
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# TODO: Update the wiki link and point to readme page or public facing doc
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally, I want to point to readme link for flag definition but those changes not there in master yet

# AutoUpdate.UpdateToLatestVersion=y

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod
Expand Down
5 changes: 4 additions & 1 deletion config/arch/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ OS.SshDir=/etc/ssh
# OS.EnableRDMA=y

# Enable or disable goal state processing auto-update, default is enabled
# AutoUpdate.Enabled=y
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# AutoUpdate.UpdateToLatestVersion=y

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod
Expand Down
5 changes: 4 additions & 1 deletion config/bigip/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ OS.SshdConfigPath=/config/ssh/sshd_config
OS.EnableRDMA=n

# Enable or disable goal state processing auto-update, default is enabled
AutoUpdate.Enabled=y
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# AutoUpdate.UpdateToLatestVersion=y

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod
Expand Down
8 changes: 6 additions & 2 deletions config/clearlinux/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ OS.OpensslPath=None
# Set the path to SSH keys and configuration files
OS.SshDir=/etc/ssh

# Enable or disable self-update, default is enabled
AutoUpdate.Enabled=y
# Enable or disable goal state processing auto-update, default is enabled
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# AutoUpdate.UpdateToLatestVersion=y

AutoUpdate.GAFamily=Prod

# Determine if the overprovisioning feature is enabled. If yes, hold extension
Expand Down
5 changes: 4 additions & 1 deletion config/coreos/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ OS.OpensslPath=None
# OS.EnableRDMA=y

# Enable or disable goal state processing auto-update, default is enabled
# AutoUpdate.Enabled=y
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# AutoUpdate.UpdateToLatestVersion=y

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod
Expand Down
5 changes: 4 additions & 1 deletion config/debian/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ OS.SshDir=/etc/ssh
# OS.EnableRDMA=y

# Enable or disable goal state processing auto-update, default is enabled
# AutoUpdate.Enabled=y
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# AutoUpdate.UpdateToLatestVersion=y

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod
Expand Down
5 changes: 4 additions & 1 deletion config/devuan/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ OS.SshDir=/etc/ssh
# OS.EnableRDMA=y

# Enable or disable goal state processing auto-update, default is enabled
# AutoUpdate.Enabled=y
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# AutoUpdate.UpdateToLatestVersion=y

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod
Expand Down
5 changes: 4 additions & 1 deletion config/freebsd/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ OS.SudoersDir=/usr/local/etc/sudoers.d
# OS.EnableRDMA=y

# Enable or disable goal state processing auto-update, default is enabled
# AutoUpdate.Enabled=y
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# AutoUpdate.UpdateToLatestVersion=y

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod
Expand Down
7 changes: 7 additions & 0 deletions config/gaia/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,15 @@ OS.SshDir=/etc/ssh
OS.EnableRDMA=n

# Enable or disable goal state processing auto-update, default is enabled
# When turned off, it reverts to the pre-installed agent that comes with image
# AutoUpdate.Enabled is a legacy parameter used only for backwards compatibility. We encourage users to transition to new option AutoUpdate.UpdateToLatestVersion
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
AutoUpdate.Enabled=n

# Enable or disable goal state processing auto-update, default is enabled
# When turned off, it remains on latest version installed on the vm
# AutoUpdate.UpdateToLatestVersion=y

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod

Expand Down
5 changes: 4 additions & 1 deletion config/iosxe/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ OS.SshDir=/etc/ssh
# OS.EnableRDMA=y

# Enable or disable goal state processing auto-update, default is enabled
AutoUpdate.Enabled=y
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# AutoUpdate.UpdateToLatestVersion=y

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod
Expand Down
8 changes: 6 additions & 2 deletions config/mariner/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ OS.OpensslPath=None
# Set the path to SSH keys and configuration files
OS.SshDir=/etc/ssh

# Enable or disable self-update, default is enabled
AutoUpdate.Enabled=y
# Enable or disable goal state processing auto-update, default is enabled
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# AutoUpdate.UpdateToLatestVersion=y

AutoUpdate.GAFamily=Prod

# Determine if the overprovisioning feature is enabled. If yes, hold extension
Expand Down
7 changes: 7 additions & 0 deletions config/nsbsd/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,15 @@ Extension.LogDir=/log/azure
# OS.EnableRDMA=y

# Enable or disable goal state processing auto-update, default is enabled
# When turned off, it reverts to the pre-installed agent that comes with image
# AutoUpdate.Enabled is a legacy parameter used only for backwards compatibility. We encourage users to transition to new option AutoUpdate.UpdateToLatestVersion
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
AutoUpdate.Enabled=n

# Enable or disable goal state processing auto-update, default is enabled
# When turned off, it remains on latest version installed on the vm
# AutoUpdate.UpdateToLatestVersion=y

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod

Expand Down
5 changes: 4 additions & 1 deletion config/openbsd/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ OS.PasswordPath=/etc/master.passwd
# OS.EnableRDMA=y

# Enable or disable goal state processing auto-update, default is enabled
# AutoUpdate.Enabled=y
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# AutoUpdate.UpdateToLatestVersion=y

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod
Expand Down
8 changes: 6 additions & 2 deletions config/photonos/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ OS.OpensslPath=None
# Set the path to SSH keys and configuration files
OS.SshDir=/etc/ssh

# Enable or disable self-update, default is enabled
AutoUpdate.Enabled=y
# Enable or disable goal state processing auto-update, default is enabled
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# AutoUpdate.UpdateToLatestVersion=y

AutoUpdate.GAFamily=Prod

# Determine if the overprovisioning feature is enabled. If yes, hold extension
Expand Down
5 changes: 4 additions & 1 deletion config/suse/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ OS.SshDir=/etc/ssh
# OS.CheckRdmaDriver=y

# Enable or disable goal state processing auto-update, default is enabled
# AutoUpdate.Enabled=y
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# AutoUpdate.UpdateToLatestVersion=y

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod
Expand Down
5 changes: 4 additions & 1 deletion config/ubuntu/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ OS.SshDir=/etc/ssh
# OS.CheckRdmaDriver=y

# Enable or disable goal state processing auto-update, default is enabled
# AutoUpdate.Enabled=y
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# AutoUpdate.UpdateToLatestVersion=y

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod
Expand Down
5 changes: 4 additions & 1 deletion config/waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ OS.SshDir=/etc/ssh
# OS.CheckRdmaDriver=y

# Enable or disable goal state processing auto-update, default is enabled
# AutoUpdate.Enabled=y
# When turned off, it remains on latest version installed on the vm
# Added this new option AutoUpdate.UpdateToLatestVersion in place of AutoUpdate.Enabled, and encourage users to transition to this new option
# See wiki[https://github.com/Azure/WALinuxAgent/wiki/FAQ#autoupdateenabled-vs-autoupdateupdatetolatestversion] for more details
# AutoUpdate.UpdateToLatestVersion=y

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod
Expand Down
4 changes: 4 additions & 0 deletions tests/common/test_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class TestConf(AgentTestCase):
"OS.CheckRdmaDriver": False,
"AutoUpdate.Enabled": True,
"AutoUpdate.GAFamily": "Prod",
"AutoUpdate.UpdateToLatestVersion": False,
Copy link
Member

Choose a reason for hiding this comment

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

default should be true

"EnableOverProvisioning": True,
"OS.AllowHTTP": False,
"OS.EnableFirewall": False
Expand Down Expand Up @@ -144,3 +145,6 @@ def test_write_agent_disabled(self):

def test_get_extensions_enabled(self):
self.assertTrue(conf.get_extensions_enabled(self.conf))

def test_get_get_auto_update_to_latest_version(self):
self.assertFalse(conf.get_auto_update_to_latest_version(self.conf))
6 changes: 5 additions & 1 deletion tests/data/test_waagent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,12 @@ OS.SshDir=/notareal/path
# OS.CheckRdmaDriver=n


# Enable or disable goal state processing auto-update, default is enabled.
# Deprecated now but keep it for backward compatibility
AutoUpdate.Enabled=y

# Enable or disable goal state processing auto-update, default is enabled
# AutoUpdate.Enabled=y
AutoUpdate.UpdateToLatestVersion=n

# Determine the update family, this should not be changed
# AutoUpdate.GAFamily=Prod
Expand Down
11 changes: 11 additions & 0 deletions tests/ga/test_agent_update_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,3 +459,14 @@ def test_it_should_save_rsm_state_of_the_most_recent_goal_state(self):
agent_update_handler.run(agent_update_handler._protocol.get_goal_state(), True)

self.assertFalse(os.path.exists(state_file), "The rsm file should be removed (file: {0})".format(state_file))

def test_it_should_not_update_to_latest_if_flag_is_disabled(self):
self.prepare_agents(count=1)

data_file = DATA_FILE.copy()
data_file['ext_conf'] = "wire/ext_conf.xml"
with self._get_agent_update_handler(test_data=data_file) as (agent_update_handler, _):
with patch("azurelinuxagent.common.conf.get_auto_update_to_latest_version", return_value=False):
agent_update_handler.run(agent_update_handler._protocol.get_goal_state(), True)

self._assert_agent_directories_exist_and_others_dont_exist(versions=[str(CURRENT_VERSION)])
2 changes: 1 addition & 1 deletion tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
EXPECTED_CONFIGURATION = \
"""AutoUpdate.Enabled = True
AutoUpdate.GAFamily = Prod
AutoUpdate.UpdateToLatestVersion = False
Copy link
Member

Choose a reason for hiding this comment

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

default should be true

Autoupdate.Frequency = 3600
DVD.MountPoint = /mnt/cdrom/secure
Debug.AgentCpuQuota = 50
Expand All @@ -41,7 +42,6 @@
Debug.CgroupLogMetrics = False
Debug.CgroupMonitorExpiryTime = 2022-03-31
Debug.CgroupMonitorExtensionName = Microsoft.Azure.Monitor.AzureMonitorLinuxAgent
Debug.DownloadNewAgents = True
Debug.EnableAgentMemoryUsageCheck = False
Debug.EnableFastTrack = True
Debug.EnableGAVersioning = True
Expand Down
Loading
Loading