From 9d77258981318e629c405ae03637592d97fdc1b6 Mon Sep 17 00:00:00 2001 From: "Nageswara Nandigam (HE/HIM)" Date: Tue, 7 Feb 2023 11:58:50 -0800 Subject: [PATCH] Don't report SF flag idf auto update is disabled --- azurelinuxagent/common/agent_supported_feature.py | 9 ++++++++- tests/common/test_agent_supported_feature.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/azurelinuxagent/common/agent_supported_feature.py b/azurelinuxagent/common/agent_supported_feature.py index 8663352a2..c3e83c514 100644 --- a/azurelinuxagent/common/agent_supported_feature.py +++ b/azurelinuxagent/common/agent_supported_feature.py @@ -14,6 +14,7 @@ # # Requires Python 2.6+ and Openssl 1.0+ # +from azurelinuxagent.common import conf class SupportedFeatureNames(object): @@ -74,10 +75,16 @@ 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. + 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 = True + __SUPPORTED = conf.get_autoupdate_enabled() def __init__(self): super(_GAVersioningGovernanceFeature, self).__init__(name=self.__NAME, diff --git a/tests/common/test_agent_supported_feature.py b/tests/common/test_agent_supported_feature.py index c2d3b1981..d8401e466 100644 --- a/tests/common/test_agent_supported_feature.py +++ b/tests/common/test_agent_supported_feature.py @@ -59,7 +59,7 @@ def test_it_should_return_ga_versioning_governance_feature_properly(self): self.assertIn(SupportedFeatureNames.GAVersioningGovernance, get_agent_supported_features_list_for_crp(), "GAVersioningGovernance should be fetched in crp_supported_features") - with patch("azurelinuxagent.common.agent_supported_feature._GAVersioningGovernanceFeature.is_supported", False): + with patch("azurelinuxagent.common.conf.get_autoupdate_enabled", return_value=False): self.assertNotIn(SupportedFeatureNames.GAVersioningGovernance, get_agent_supported_features_list_for_crp(), "GAVersioningGovernance should not be fetched in crp_supported_features as not supported")