diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2005-09-27 21:49:53 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2005-09-27 21:49:53 +0000 |
commit | eb6060070afdeceabc4ecb7511b8b66b8fa267db (patch) | |
tree | 0a54eb03a2bd21c7f16624b6929e291fa2a02693 /src/lib/Server | |
parent | 5cb184560231b59906b6fb343b211773b3c7ccfe (diff) | |
download | bcfg2-eb6060070afdeceabc4ecb7511b8b66b8fa267db.tar.gz bcfg2-eb6060070afdeceabc4ecb7511b8b66b8fa267db.tar.bz2 bcfg2-eb6060070afdeceabc4ecb7511b8b66b8fa267db.zip |
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
Diffstat (limited to 'src/lib/Server')
-rw-r--r-- | src/lib/Server/Plugins/Chiba.py | 8 |
1 files changed, 5 insertions, 3 deletions
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 |