Skip to content

Commit

Permalink
Create a copy of the identityfile list.
Browse files Browse the repository at this point in the history
The copy is needed else the original
identityfile list is in the internal
config list is updated when we modify
the return dictionary.
  • Loading branch information
lndbrg committed Feb 28, 2013
1 parent 109d2b2 commit f41fc8f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion paramiko/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ def lookup(self, hostname):
for match in matches:
for key, value in match['config'].iteritems():
if key not in ret:
ret[key] = value
# Create a copy of the original value,
# else it will reference the original list
# in self._config and update that value too
# when the extend() is being called.
ret[key] = value[:]
elif key == 'identityfile':
ret[key].extend(value)
ret = self._expand_variables(ret, hostname)
Expand Down

0 comments on commit f41fc8f

Please sign in to comment.