Skip to content

Commit

Permalink
Rename Debug.FetchVmSettings to Debug.EnableFastTrack (#2324)
Browse files Browse the repository at this point in the history
Co-authored-by: narrieta <narrieta>
  • Loading branch information
narrieta authored Aug 11, 2021
1 parent 582d89a commit 265f46e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
8 changes: 4 additions & 4 deletions azurelinuxagent/common/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def load_conf_from_file(conf_file_path, conf=__conf__):
"Debug.CgroupLogMetrics": False,
"Debug.CgroupDisableOnProcessCheckFailure": True,
"Debug.CgroupDisableOnQuotaCheckFailure": True,
"Debug.FetchVmSettings": False,
"Debug.EnableFastTrack": False,
}


Expand Down Expand Up @@ -509,10 +509,10 @@ def get_cgroup_disable_on_quota_check_failure(conf=__conf__):
"""
return conf.get_switch("Debug.CgroupDisableOnQuotaCheckFailure", True)

def get_fetch_vm_settings(conf=__conf__):
def get_enable_fast_track(conf=__conf__):
"""
If True, the agent will query the extensions goal state (via the vmSettings API)
If True, the agent use FastTrack when retrieving goal states
NOTE: This option is experimental and may be removed in later versions of the Agent.
"""
return conf.get_switch("Debug.FetchVmSettings", False)
return conf.get_switch("Debug.EnableFastTrack", False)
2 changes: 1 addition & 1 deletion azurelinuxagent/common/protocol/wire.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ def update_goal_state(self, forced=False):

if new_goal_state is not None:
self._goal_state = new_goal_state
if conf.get_fetch_vm_settings():
if conf.get_enable_fast_track():
self.update_extensions_goal_state()
self._save_goal_state()
self._update_host_plugin(new_goal_state.container_id, new_goal_state.role_config_name)
Expand Down
9 changes: 4 additions & 5 deletions tests/protocol/test_goal_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

_original_http_request = restutil.http_request

@patch("azurelinuxagent.common.protocol.wire.conf.get_fetch_vm_settings", return_value=True)
@patch("azurelinuxagent.common.protocol.wire.conf.get_enable_fast_track", return_value=True)
class GoalStateTestCase(HttpRequestPredicates, AgentTestCase):
def test_fetch_goal_state_should_raise_on_incomplete_goal_state(self, _):
with mock_wire_protocol(mockwiredata.DATA_FILE) as protocol:
Expand All @@ -32,10 +32,9 @@ def test_fetch_goal_state_should_raise_on_incomplete_goal_state(self, _):

def test_update_goal_state_should_save_goal_state(self, _):
with mock_wire_protocol(mockwiredata.DATA_FILE_VM_SETTINGS) as protocol:
with patch("azurelinuxagent.common.protocol.wire.conf.get_fetch_vm_settings", return_value=True):
protocol.mock_wire_data.set_incarnation(999)
protocol.mock_wire_data.set_etag(888)
protocol.update_goal_state()
protocol.mock_wire_data.set_incarnation(999)
protocol.mock_wire_data.set_etag(888)
protocol.update_goal_state()

extensions_config_file = os.path.join(conf.get_lib_dir(), "ExtensionsConfig.999.xml")
vm_settings_file = os.path.join(conf.get_lib_dir(), "VmSettings.888.json")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
Debug.CgroupDisableOnProcessCheckFailure = True
Debug.CgroupDisableOnQuotaCheckFailure = True
Debug.CgroupLogMetrics = False
Debug.FetchVmSettings = False
Debug.EnableFastTrack = False
DetectScvmmEnv = False
EnableOverProvisioning = True
Extension.LogDir = /var/log/azure
Expand Down

0 comments on commit 265f46e

Please sign in to comment.