diff options
-rw-r--r-- | paramiko/config.py | 10 | ||||
-rw-r--r-- | sites/www/changelog.rst | 3 |
2 files changed, 9 insertions, 4 deletions
diff --git a/paramiko/config.py b/paramiko/config.py index f650ee24..96ec9ef7 100644 --- a/paramiko/config.py +++ b/paramiko/config.py @@ -83,7 +83,7 @@ class SSHConfig (object): #identityfile, localforward, remoteforward keys are special cases, since they are allowed to be # specified multiple times and they should be tried in order # of specification. - + elif key in ['identityfile', 'localforward', 'remoteforward']: if key in host['config']: host['config'][key].append(value) @@ -200,10 +200,12 @@ class SSHConfig (object): for find, replace in replacements[k]: if isinstance(config[k], list): for item in range(len(config[k])): - config[k][item] = config[k][item].\ - replace(find, str(replace)) + if find in config[k][item]: + config[k][item] = config[k][item].\ + replace(find, str(replace)) else: - config[k] = config[k].replace(find, str(replace)) + if find in config[k]: + config[k] = config[k].replace(find, str(replace)) return config diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index e6b44178..87bb8873 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,9 @@ Changelog ========= +* :bug:`376` Be less aggressive about expanding variables in ``ssh_config`` + files, which results in a speedup of SSH config parsing. Credit to Olle + Lundberg. * :support:`324 backported` A bevvy of documentation typo fixes, courtesy of Roy Wellington. * :bug:`312` `paramiko.transport.Transport` had a bug in its ``__repr__`` which |