Create a copy of the identityfile list.

The copy is needed else the original
identityfile list is in the internal
config list is updated when we modify
the return dictionary.
This commit is contained in:
Olle Lundberg 2012-11-20 12:43:40 +01:00
parent 5670e111c9
commit a07a339006
1 changed files with 5 additions and 1 deletions

View File

@ -122,7 +122,11 @@ class SSHConfig (object):
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)