diff options
author | Johnson Shi <Johnson.Shi@microsoft.com> | 2020-10-16 08:54:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-16 11:54:38 -0400 |
commit | 8766784f4b1d1f9f6a9094e1268e4accb811ea7f (patch) | |
tree | d654af968ed5b185402802a3cafea7c7357e0b26 /tests/unittests/test_datasource/test_azure_helper.py | |
parent | c0e8480678e3a9173c9de1271f651fb3ba375f22 (diff) | |
download | vyos-cloud-init-8766784f4b1d1f9f6a9094e1268e4accb811ea7f.tar.gz vyos-cloud-init-8766784f4b1d1f9f6a9094e1268e4accb811ea7f.zip |
DataSourceAzure: write marker file after report ready in preprovisioning (#590)
DataSourceAzure previously writes the preprovisioning
reported ready marker file before it goes through the
report ready workflow. On certain VM instances, the
marker file is successfully written but then reporting
ready fails.
Upon rare VM reboots by the platform, cloud-init sees
that the report ready marker file already exists.
The existence of this marker file tells cloud-init
not to report ready again (because it mistakenly
assumes that it already reported ready in
preprovisioning).
In this scenario, cloud-init instead erroneously
takes the reprovisioning workflow instead of
reporting ready again.
Diffstat (limited to 'tests/unittests/test_datasource/test_azure_helper.py')
-rw-r--r-- | tests/unittests/test_datasource/test_azure_helper.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/unittests/test_datasource/test_azure_helper.py b/tests/unittests/test_datasource/test_azure_helper.py index 5c31b8be..6e004e34 100644 --- a/tests/unittests/test_datasource/test_azure_helper.py +++ b/tests/unittests/test_datasource/test_azure_helper.py @@ -742,7 +742,8 @@ class TestGetMetadataGoalStateXMLAndReportReadyToFabric(CiTestCase): self.assertEqual(1, shim.return_value.clean_up.call_count) @mock.patch.object(azure_helper, 'WALinuxAgentShim') - def test_failure_in_registration_calls_clean_up(self, shim): + def test_failure_in_registration_propagates_exc_and_calls_clean_up( + self, shim): shim.return_value.register_with_azure_and_fetch_data.side_effect = ( SentinelException) self.assertRaises(SentinelException, |