← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~raharper/cloud-init:fix/cloudtests-pylint-type-hint into cloud-init:master

 

Ryan Harper has proposed merging ~raharper/cloud-init:fix/cloudtests-pylint-type-hint into cloud-init:master.

Commit message:
cloud_tests: help pylint
    
pylint missed finding a typo in the lxd platform because it could not
determine that the variable was being used was a string.  The variable
was set by loading a yaml file which pylint couldn't know that it
would be a string.  In these cases, we can be more explicit.


Requested reviews:
  cloud-init commiters (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/343733
-- 
Your team cloud-init commiters is requested to review the proposed merge of ~raharper/cloud-init:fix/cloudtests-pylint-type-hint into cloud-init:master.
diff --git a/tests/cloud_tests/platforms/lxd/instance.py b/tests/cloud_tests/platforms/lxd/instance.py
index 1c17c78..d396519 100644
--- a/tests/cloud_tests/platforms/lxd/instance.py
+++ b/tests/cloud_tests/platforms/lxd/instance.py
@@ -208,7 +208,7 @@ def _has_proper_console_support():
     if 'console' not in info.get('api_extensions', []):
         reason = "LXD server does not support console api extension"
     else:
-        dver = info.get('environment', {}).get('driver_version', "")
+        dver = str(info.get('environment', {}).get('driver_version', ""))
         if dver.startswith("2.") or dver.startswith("1."):
             reason = "LXD Driver version not 3.x+ (%s)" % dver
         else:

Follow ups