Avoid using len(x)
to check if x is empty
This cases are using `len()` to check if collection has items. As collections have a boolean representation too, directly check for true / false. Change-Id: I1e552db99fbe6d33ad43bb710af924261dcebb46
This commit is contained in:
@@ -43,7 +43,7 @@ class SchemaValidator(object):
|
||||
except jsonschema.ValidationError as ex:
|
||||
# NOTE: For whole OpenStack message consistency, this error
|
||||
# message has been written in a format consistent with WSME.
|
||||
if len(ex.path) > 0:
|
||||
if ex.path:
|
||||
# NOTE(lbragstad): Here we could think about using iter_errors
|
||||
# as a method of providing invalid parameters back to the
|
||||
# user.
|
||||
|
Reference in New Issue
Block a user