From a1fecb3f28228b9e3a87ebb0a3c70e0fac97519a Mon Sep 17 00:00:00 2001 From: Nageswara Nandigam <84482346+nagworld9@users.noreply.github.com> Date: Mon, 13 Feb 2023 14:39:46 -0800 Subject: [PATCH] Don't report SF flag idf auto update is disabled (#2754) --- 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 8663352a24..c3e83c5142 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 c2d3b1981e..d8401e4661 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")