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 (* No man is an island if he's on at least (*
*) Sysadmin Head *) one mailing list. *)
(* -SBI Japannext- (* (*