summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Generators
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2004-10-13 20:04:03 +0000
committerNarayan Desai <desai@mcs.anl.gov>2004-10-13 20:04:03 +0000
commit09b9fde79e875cb2af181ea3155b8383f9d0dbbe (patch)
treecf670f4dd38aa60fc32b911cec3d16a7ff05df66 /src/lib/Server/Generators
parenta19c34c426bd4e5fd2591fa5b856a66dc223ed8e (diff)
downloadbcfg2-09b9fde79e875cb2af181ea3155b8383f9d0dbbe.tar.gz
bcfg2-09b9fde79e875cb2af181ea3155b8383f9d0dbbe.tar.bz2
bcfg2-09b9fde79e875cb2af181ea3155b8383f9d0dbbe.zip
fix lookup failure case
(Logical change 1.96) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@440 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Generators')
-rw-r--r--src/lib/Server/Generators/sshbase.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/Server/Generators/sshbase.py b/src/lib/Server/Generators/sshbase.py
index 3d68d1916..eb0a8b392 100644
--- a/src/lib/Server/Generators/sshbase.py
+++ b/src/lib/Server/Generators/sshbase.py
@@ -67,7 +67,12 @@ class sshbase(Generator):
for f in self.repository.entries.keys():
if ".pub.H_" in f:
h = f.split('_')[-1]
- output += "%s,%s.mcs.anl.gov,%s %s"%(h, h, gethostbyname(h), self.repository.entries[f].data)
+ try:
+ ip = gethostbyname(h)
+ output += "%s,%s.mcs.anl.gov,%s %s"%(h, h, ip, self.repository.entries[f].data)
+ except:
+ output += "%s,%s.mcs.anl.gov %s"%(h, h, self.repository.entries[f].data)
+ syslog(LOG_ERR, "Failed to resolve host %s"%(h))
self.repository.entries['ssh_known_hosts'].data = output
def GenerateHostKeys(self,client):