diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-05-02 04:58:46 -0700 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-05-02 04:58:46 -0700 |
commit | 7cbd57a4281bd3b4a93479716b7a743257b4475f (patch) | |
tree | e0e183ab3fdba3ecb4d8d05808d13bcabd295fe9 /src/lib/Bcfg2/Server/Plugins/SSHbase.py | |
parent | 11fe02d3358aa7ff4634f924a04fc1f5274ed6d4 (diff) | |
parent | 8d2ea0ad333b023aed1be7e2059c4200aa80ee76 (diff) | |
download | bcfg2-7cbd57a4281bd3b4a93479716b7a743257b4475f.tar.gz bcfg2-7cbd57a4281bd3b4a93479716b7a743257b4475f.tar.bz2 bcfg2-7cbd57a4281bd3b4a93479716b7a743257b4475f.zip |
Merge pull request #71 from AlexanderS/maint
SSHbase: add support for ipv6 addresses in known_hosts file
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/SSHbase.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/SSHbase.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/SSHbase.py b/src/lib/Bcfg2/Server/Plugins/SSHbase.py index fc07a90e9..5aa7c4d9e 100644 --- a/src/lib/Bcfg2/Server/Plugins/SSHbase.py +++ b/src/lib/Bcfg2/Server/Plugins/SSHbase.py @@ -172,7 +172,7 @@ class SSHbase(Bcfg2.Server.Plugin.Plugin, for name in names[cmeta.hostname]: newnames.add(name.split('.')[0]) try: - newips.add(self.get_ipcache_entry(name)[0]) + newips.update(self.get_ipcache_entry(name)[0]) except: # pylint: disable=W0702 continue names[cmeta.hostname].update(newnames) @@ -288,7 +288,7 @@ class SSHbase(Bcfg2.Server.Plugin.Plugin, else: # need to add entry try: - ipaddr = socket.gethostbyname(client) + ipaddr = set([addr[0] for (_, _, _, _, addr) in socket.getaddrinfo(client, None)]) self.ipcache[client] = (ipaddr, client) return (ipaddr, client) except socket.gaierror: |