diff options
| author | Ian Cordasco <ian.cordasco@rackspace.com> | 2014-11-26 12:20:40 -0600 |
|---|---|---|
| committer | Ian Cordasco <ian.cordasco@rackspace.com> | 2014-11-26 12:20:40 -0600 |
| commit | a1bb3eb0a5a1ffde5fd0a8621c32b31ef6a3c4fb (patch) | |
| tree | 2d3be64afda92521bdf379267f909fefeb15fd25 /glanceclient/v2/shell.py | |
| parent | 3b6754a8cc8932cd9645d54acc8d02826993a546 (diff) | |
| download | python-glanceclient-a1bb3eb0a5a1ffde5fd0a8621c32b31ef6a3c4fb.tar.gz | |
Use any instead of False in generator
any is both idiomatic and easier to read. There's no performance difference
because both will stop as soon as a matching value is found.
Change-Id: Ia527d96844015085cc289869a3c4d2722db1043c
Diffstat (limited to 'glanceclient/v2/shell.py')
| -rw-r--r-- | glanceclient/v2/shell.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/glanceclient/v2/shell.py b/glanceclient/v2/shell.py index 238fcd3..95715e3 100644 --- a/glanceclient/v2/shell.py +++ b/glanceclient/v2/shell.py @@ -111,7 +111,7 @@ def do_image_list(gc, args): filter_items = [(key, getattr(args, key)) for key in filter_keys] if args.properties: filter_properties = [prop.split('=', 1) for prop in args.properties] - if False in (len(pair) == 2 for pair in filter_properties): + if any(len(pair) != 2 for pair in filter_properties): utils.exit('Argument --property-filter expected properties in the' ' format KEY=VALUE') filter_items += filter_properties |
