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:
Raildo Mascena
2016-02-17 13:24:08 -03:00
parent d32c7b0e7f
commit e5f91ce479
3 changed files with 3 additions and 3 deletions

View File

@@ -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.