Use in dict rather than "in dict.keys()". Fix linting warnings about "not in". (#8298)

* Fixed a few linting warnings for if not x in y.

These should have been caught by pylint, but weren't.

* Replaced "x in y.keys()" with "x in y".

It's much faster, and more Pythonic.
This commit is contained in:
Mads Jensen
2020-09-19 11:35:49 +02:00
committed by GitHub
parent b551b6ee73
commit 501df0dc4e
10 changed files with 18 additions and 18 deletions
+1 -1
View File
@@ -322,7 +322,7 @@ def create_client_instance(ec2_client, target, security_group_id, subnet_id):
else:
# 32 bit systems
machine_type = 'c1.medium'
if 'userdata' in target.keys():
if 'userdata' in target:
userdata = target['userdata']
else:
userdata = ''