DRY up the code for populating the return list
This commit is contained in:
parent
221131fa21
commit
78654e82ec
|
@ -121,13 +121,10 @@ class SSHConfig (object):
|
||||||
ret = {}
|
ret = {}
|
||||||
for match in matches:
|
for match in matches:
|
||||||
for key, value in match['config'].iteritems():
|
for key, value in match['config'].iteritems():
|
||||||
if key == 'identityfile':
|
if key not in ret:
|
||||||
if key in ret:
|
|
||||||
ret['identityfile'].extend(value)
|
|
||||||
else:
|
|
||||||
ret['identityfile'] = value
|
|
||||||
elif key not in ret:
|
|
||||||
ret[key] = value
|
ret[key] = value
|
||||||
|
elif key == 'identityfile':
|
||||||
|
ret[key].extend(value)
|
||||||
ret = self._expand_variables(ret, hostname)
|
ret = self._expand_variables(ret, hostname)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue