summaryrefslogtreecommitdiff
path: root/cloudinit/config/schema.py
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2020-04-27 16:01:10 -0400
committerGitHub <noreply@github.com>2020-04-27 16:01:10 -0400
commit429c1ab9b0ee04f5a2287b8579c02907f30e795f (patch)
treeb56a449fb1e79a19b67089952e815ed9b86d18a5 /cloudinit/config/schema.py
parent61a19249c2010743a467a51f8f0750712c2d92e0 (diff)
downloadvyos-cloud-init-429c1ab9b0ee04f5a2287b8579c02907f30e795f.tar.gz
vyos-cloud-init-429c1ab9b0ee04f5a2287b8579c02907f30e795f.zip
schema: ignore spurious pylint error (#332)
The line in question is in the code path handling older versions of jsonschema. In that context it _is_ correct, but when pylint analyses it against the latest jsonschema it (incorrectly) detects an error.
Diffstat (limited to 'cloudinit/config/schema.py')
-rw-r--r--cloudinit/config/schema.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cloudinit/config/schema.py b/cloudinit/config/schema.py
index 5356f492..a295d63d 100644
--- a/cloudinit/config/schema.py
+++ b/cloudinit/config/schema.py
@@ -103,7 +103,10 @@ def validate_cloudconfig_schema(config, schema, strict=False):
cloudinitValidator = extend(Draft4Validator, type_checker=type_checker)
else: # jsonschema 2.6 workaround
types = Draft4Validator.DEFAULT_TYPES
- types['string'] = (str, bytes) # Allow bytes as well as string
+ # Allow bytes as well as string (and disable a spurious
+ # unsupported-assignment-operation pylint warning which appears because
+ # this code path isn't written against the latest jsonschema).
+ types['string'] = (str, bytes) # pylint: disable=E1137
cloudinitValidator = create(
meta_schema=Draft4Validator.META_SCHEMA,
validators=Draft4Validator.VALIDATORS,