Skip to content

Commit

Permalink
feat(azure): parse ProvisionGuestProxyAgent as bool (#5126)
Browse files Browse the repository at this point in the history
  • Loading branch information
KsenijaS committed Apr 5, 2024
1 parent 516fad6 commit ffacae6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions cloudinit/sources/helpers/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ def _parse_platform_settings_section(self, root):
self.provision_guest_proxy_agent = self._parse_property(
platform_settings,
"ProvisionGuestProxyAgent",
parse_bool=True,
default=False,
required=False,
)
Expand Down
12 changes: 10 additions & 2 deletions tests/unittests/sources/test_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2827,13 +2827,21 @@ def test_read_azure_ovf_with_savable_type(self):
self.assertTrue(cfg["PreprovisionedVm"])
self.assertEqual("Savable", cfg["PreprovisionedVMType"])

def test_read_azure_ovf_with_proxy_guest_agent(self):
def test_read_azure_ovf_with_proxy_guest_agent_true(self):
"""The read_azure_ovf method should set ProvisionGuestProxyAgent
cfg flag to True."""
content = construct_ovf_env(provision_guest_proxy_agent=True)
ret = dsaz.read_azure_ovf(content)
cfg = ret[2]
self.assertTrue(cfg["ProvisionGuestProxyAgent"])
assert cfg["ProvisionGuestProxyAgent"] is True

def test_read_azure_ovf_with_proxy_guest_agent_false(self):
"""The read_azure_ovf method should set ProvisionGuestProxyAgent
cfg flag to False."""
content = construct_ovf_env(provision_guest_proxy_agent=False)
ret = dsaz.read_azure_ovf(content)
cfg = ret[2]
assert cfg["ProvisionGuestProxyAgent"] is False


@pytest.mark.parametrize(
Expand Down

0 comments on commit ffacae6

Please sign in to comment.