diff options
| author | Ryan Harper <ryan.harper@canonical.com> | 2020-02-13 14:11:17 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-13 15:11:17 -0500 |
| commit | ecffd25df840277ab1fa7d5372659abe833cacbe (patch) | |
| tree | 42565263c109485e8e83db70e72696776b792af9 /tests/cloud_tests/platforms/azurecloud/platform.py | |
| parent | 81c7477a55b509a33af38bc502b1e9dd4ea643ff (diff) | |
| download | vyos-cloud-init-ecffd25df840277ab1fa7d5372659abe833cacbe.tar.gz vyos-cloud-init-ecffd25df840277ab1fa7d5372659abe833cacbe.zip | |
azurecloud: fix issues with instances not starting (#205)
The azurecloud platform did not always start instances
during collect runs. This was a result of two issues. First
the image class _instance method did not invoke the start()
method which then allowed collect stage to attempt to run
scripts without an endpoint. Second, azurecloud used the
image_id as both an instance handle (which is typically
vmName in azure api) as well as an image handle (for image
capture). Resolve this by adding a .vm_name property to
the AzureCloudInstance and reference this property in
AzureCloudImage.
Also in this branch
- Fix error encoding user-data when value is None
- Add additional logging in AzureCloud platform
- Update logging format to print pathname,funcName and line number
This greatly eases debugging.
LP: #1861921
Diffstat (limited to 'tests/cloud_tests/platforms/azurecloud/platform.py')
| -rw-r--r-- | tests/cloud_tests/platforms/azurecloud/platform.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/cloud_tests/platforms/azurecloud/platform.py b/tests/cloud_tests/platforms/azurecloud/platform.py index 77f159eb..cb62a74b 100644 --- a/tests/cloud_tests/platforms/azurecloud/platform.py +++ b/tests/cloud_tests/platforms/azurecloud/platform.py @@ -74,8 +74,9 @@ class AzureCloudPlatform(Platform): @param user_data: test user-data to pass to instance @return_value: cloud_tests.instances instance """ - user_data = str(base64.b64encode( - user_data.encode('utf-8')), 'utf-8') + if user_data is not None: + user_data = str(base64.b64encode( + user_data.encode('utf-8')), 'utf-8') return AzureCloudInstance(self, properties, config, features, image_id, user_data) |
