From 3f85aa3abd7ffa7e6533af1dd3e070a1f776701f Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 7 Aug 2017 19:30:01 +0100 Subject: [PATCH] Use a real list comprehension rather than list() around a generator (#25594) It's faster and more idiomatic. --- contrib/inventory/ec2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/inventory/ec2.py b/contrib/inventory/ec2.py index b786c51fcc..16f52890b2 100755 --- a/contrib/inventory/ec2.py +++ b/contrib/inventory/ec2.py @@ -806,7 +806,7 @@ class Ec2Inventory(object): errors.append(' - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment vars found but may not be correct') boto_paths = ['/etc/boto.cfg', '~/.boto', '~/.aws/credentials'] - boto_config_found = list(p for p in boto_paths if os.path.isfile(os.path.expanduser(p))) + boto_config_found = [p for p in boto_paths if os.path.isfile(os.path.expanduser(p))] if len(boto_config_found) > 0: errors.append(" - Boto configs found at '%s', but the credentials contained may not be correct" % ', '.join(boto_config_found)) else: