summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-01-20 22:46:14 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-01-20 22:46:14 +0000
commiteb5ea7d2eaa31d43c92c8f619269cb15512accae (patch)
tree9bf383bed440b71f0be9fdf68c6e33788f60fe7e /src/lib
parentef59b057fa833c74ecf86576370f007ae6255b02 (diff)
downloadbcfg2-eb5ea7d2eaa31d43c92c8f619269cb15512accae.tar.gz
bcfg2-eb5ea7d2eaa31d43c92c8f619269cb15512accae.tar.bz2
bcfg2-eb5ea7d2eaa31d43c92c8f619269cb15512accae.zip
fix localhost line
2005/01/20 15:50:02-06:00 anl.gov!desai fix one hardcoded domain problem 2005/01/20 13:41:28-06:00 anl.gov!desai fix public key perms (Logical change 1.193) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@821 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Generators/SSHbase.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/Server/Generators/SSHbase.py b/src/lib/Server/Generators/SSHbase.py
index 7d76aa6d9..7c0a015f4 100644
--- a/src/lib/Server/Generators/SSHbase.py
+++ b/src/lib/Server/Generators/SSHbase.py
@@ -51,11 +51,9 @@ class SSHbase(Generator):
client = metadata.hostname
filedata = self.repository.entries['ssh_known_hosts'].data
try:
- ipaddr = gethostbyname(client)
- # add client-specific key lines
for hostkey in [keytmpl % client for keytmpl in self.pubkeys]:
- filedata += "%s,%s,%s %s" % (client, "%s.mcs.anl.gov"%(client),
- ipaddr, self.repository.entries[hostkey].data)
+ filedata += "localhost,localhost.localdomain,127.0.0.1 %s" % (
+ self.repository.entries[hostkey].data)
except gaierror:
self.LogError("DNS lookup failed for client %s" % client)
entry.attrib.update({'owner':'root', 'group':'root', 'perms':'0644'})
@@ -64,13 +62,13 @@ class SSHbase(Generator):
def build_hk(self, entry, metadata):
'''This binds host key data into entries'''
client = metadata.hostname
- filename = "%s.H_%s" % (entry.attrib['name'].split('/')[-1], client)
+ filename = "%s.H_%s" % (entry.get('name').split('/')[-1], client)
if filename not in self.repository.entries.keys():
self.GenerateHostKeys(client)
self.GenerateKnownHosts()
keydata = self.repository.entries[filename].data
perms = '0600'
- if filename[-4:] == '.pub':
+ if entry.get('name')[-4:] == '.pub':
perms = '0644'
entry.attrib.update({'owner':'root', 'group':'root', 'perms':perms})
entry.text = keydata