Close all open filehandle (#50544)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde
2019-01-11 20:44:08 +05:30
committed by Brian Coca
parent 94a1d86d70
commit db8702cdb8
21 changed files with 81 additions and 47 deletions

View File

@@ -115,8 +115,8 @@ def main():
public_key = module.params['public_key']
if module.params['public_key_file']:
public_key = open(module.params['public_key_file']).read()
public_key = public_key.rstrip()
with open(module.params['public_key_file']) as public_key_fh:
public_key = public_key_fh.read().rstrip()
sdk, cloud = openstack_cloud_from_module(module)
try: