Skip to content

Commit

Permalink
fixed a pylint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
allmightyspiff committed Apr 27, 2021
1 parent bdade31 commit 486b0d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SoftLayer/CLI/sshkey/add.py
Expand Up @@ -33,9 +33,9 @@ def cli(env, label, in_file, key, note):
if key:
key_text = key
else:
key_file = open(path.expanduser(in_file), 'rU')
key_text = key_file.read().strip()
key_file.close()
with open(path.expanduser(in_file), 'rU') as key_file:
key_text = key_file.read().strip()
key_file.close()

mgr = SoftLayer.SshKeyManager(env.client)
result = mgr.add_key(key_text, label, note)
Expand Down

0 comments on commit 486b0d0

Please sign in to comment.