From eb6060070afdeceabc4ecb7511b8b66b8fa267db Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 27 Sep 2005 21:49:53 +0000 Subject: update for fully qualified hostnames (Logical change 1.324) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1322 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Plugins/Chiba.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib/Server/Plugins/Chiba.py b/src/lib/Server/Plugins/Chiba.py index 3376b6125..15de43952 100644 --- a/src/lib/Server/Plugins/Chiba.py +++ b/src/lib/Server/Plugins/Chiba.py @@ -31,9 +31,11 @@ class Chiba(Plugin): entry.attrib['group'] = 'root' entry.attrib['perms'] = '0644' try: - myriaddr = gethostbyname("%s-myr" % metadata.hostname) + myriname = "%s-myr.%s" % (metadata.hostname.split('.')[0], + ".".join(metadata.hostname.split('.')[1:])) + myriaddr = gethostbyname(myriname) except gaierror: - syslog(LOG_ERR, "Failed to resolve %s-myr"% metadata.hostname) - raise PluginExecutionError, ("%s-myr" % metadata.hostname, 'lookup') + syslog(LOG_ERR, "Failed to resolve %s"% myriname) + raise PluginExecutionError, (myriname, 'lookup') entry.text = self.repo.entries['interfaces-template'].data % myriaddr -- cgit v1.2.3-1-g7c22