DRY up the code for populating the return list

This commit is contained in:
Olle Lundberg 2012-11-20 00:45:32 +01:00
parent 221131fa21
commit 78654e82ec
1 changed files with 3 additions and 6 deletions

View File

@ -121,13 +121,10 @@ class SSHConfig (object):
ret = {}
for match in matches:
for key, value in match['config'].iteritems():
if key == 'identityfile':
if key in ret:
ret['identityfile'].extend(value)
else:
ret['identityfile'] = value
elif key not in ret:
if key not in ret:
ret[key] = value
elif key == 'identityfile':
ret[key].extend(value)
ret = self._expand_variables(ret, hostname)
return ret