I posted the mail below to the user mailing list, but I thought I'd send
you the patch for our workaround, to see what you have to say.
To summarize the email, for some hosts we need to override the "server"
to include a port in the string (like 10.68.1.128:10080) and the latest
stable branch is not working for us since commit
236ad1ca9f30012cadf9f55b8acf8b23cc5de673 introduced a
socket.gethostbyname_ex(server).
The following changes since commit 913884606eb813f7b4132db9f08540c81caa676d:
The clean_link_cache method was calling subprocess_call without a logger (2010-07-14
12:19:47 -0400)
are available in the git repository at:
http://github.com/chutzimir/cobbler.git host-port-override/stable
Georgi Georgiev (1):
Do not die when there is a port in the http_server value
cobbler/pxegen.py | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
The following changes since commit 982b6f55a94a8bcaee8e1e44c02b0e629cf22224:
Fix cobbler check tftp typo. (2010-08-18 16:46:57 -0300)
are available in the git repository at:
http://github.com/chutzimir/cobbler.git host-port-override/master
Georgi Georgiev (1):
Do not die when there is a port in the http_server value
cobbler/pxegen.py | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
Quoting Georgi Georgiev at 27/09/2010-21:36:53(+0900):
For a couple of hosts behind a couple of firewalls, we have to
override
both the server and the port that the kickstart should download the RPMs
from. As these are virtual machines, with 2.0.4 it is quite easy to
override the "server" value to something like "10.68.1.128:10080" and
an
ssh tunnel at 10.68.1.128 does the rest of the work. This works well,
because it generates a kickstart string like:
url --url=http://10.68.1.128:10080/cblr/links/Fedora-13-x86_64
The reason this works is that the http_port is ignored (we use the
default 80) and so the override string fits just fine as a workaround.
However, commit 236ad1ca9f30012cadf9f55b8acf8b23cc5de673 (it is in
2.0.5) broke this workaround with the following error halfway through
"cobbler sync":
Mon Sep 27 17:25:22 2010 - INFO | Exception occured: socket.gaierror
Mon Sep 27 17:25:22 2010 - INFO | Exception value: (-2, 'Name or service not
known')
Mon Sep 27 17:25:22 2010 - INFO | Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 95, in run
rc = self._run(self)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 184, in
runner
return
self.remote.api.sync(self.options.get("verbose",False),logger=self.logger)
File "/usr/lib/python2.4/site-packages/cobbler/api.py", line 610, in sync
return sync.run()
File "/usr/lib/python2.4/site-packages/cobbler/action_sync.py", line 122, in
run
self.pxegen.write_all_system_files(x)
File "/usr/lib/python2.4/site-packages/cobbler/pxegen.py", line 294, in
write_all_system_files
self.write_pxe_file(f2,system,profile,distro,working_arch)
File "/usr/lib/python2.4/site-packages/cobbler/pxegen.py", line 565, in
write_pxe_file
ipaddress = socket.gethostbyname_ex(blended["http_server"])[2][0]
Obviously, since our "server" includes a port, gethostbyname_ex is
failing to resolve "10.68.1.128:10080".
I don't mind making the commits myself (both for master and stable) but
I would like to know what the preferred solution would be. I can think
of two approaches:
a) Introduce a server_port setting for systems (to complement the
current "server" override) and we can then set that to 10080.
b) fix the calls to gethostbyname_ex so they only replace the hostname
with an IP, and leave anything after a trailing ":" intact
Thoughts?
--
( Georgi Georgiev ( If it happens once, it's a bug. If it (
) Sysadmin Head ) happens twice, it's a feature. If it )
( -SBI Japannext- ( happens more than twice, it's a design (
) ------------------- ) philosophy. )