get_profile() - Use tuple instead of list.

Fixes fix 39b7e606 handle new OpenSSH DSA key format.
This commit is contained in:
Frederick Grose 2019-01-01 14:57:45 -05:00 committed by James Cameron
parent 39b7e606df
commit f228909710

View File

@ -115,12 +115,12 @@ class Profile(object):
end_found = False
for l in lines:
l = l.strip()
if l.startswith(['-----BEGIN DSA PRIVATE KEY-----',
'-----BEGIN OPENSSH PRIVATE KEY-----']):
if l.startswith(('-----BEGIN DSA PRIVATE KEY-----',
'-----BEGIN OPENSSH PRIVATE KEY-----')):
begin_found = True
continue
if l.startswith(['-----END DSA PRIVATE KEY-----',
'-----END OPENSSH PRIVATE KEY-----']):
if l.startswith(('-----END DSA PRIVATE KEY-----',
'-----END OPENSSH PRIVATE KEY-----')):
end_found = True
continue
key += l