summaryrefslogtreecommitdiffstats
path: root/scripts/index.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-06-16 17:58:42 -0400
committerMichael DeHaan <mdehaan@redhat.com>2008-06-16 17:58:42 -0400
commit5c147357160796edbe69536265a773e98dc370ae (patch)
tree548c23224101cbfb69418475c2053385a36761b9 /scripts/index.py
parenta7c317dd5fa995de2668f531a1cdd819542daf4c (diff)
downloadcobbler-5c147357160796edbe69536265a773e98dc370ae.tar.gz
cobbler-5c147357160796edbe69536265a773e98dc370ae.tar.xz
cobbler-5c147357160796edbe69536265a773e98dc370ae.zip
This change allows the mod_python aspects to work if the http_port is not 80. This works by letting the mod python components parse the config file. Currently this is not done using the Cobbler API because mod_python doensn't have sufficient permissions to invoke an API handle, but it does have permissions to open the settings file as read only. Ideally this should probably use the YAML parser but this was sufficiently light/fast.
Diffstat (limited to 'scripts/index.py')
-rwxr-xr-xscripts/index.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/index.py b/scripts/index.py
index 8d10129a..160d0b51 100755
--- a/scripts/index.py
+++ b/scripts/index.py
@@ -20,6 +20,7 @@ import xmlrpclib
import cgi
import os
from cobbler.webui import CobblerWeb
+import cobbler.utils as utils
XMLRPC_SERVER = "http://127.0.0.1:25152" # was http://127.0.0.1/cobbler_api_rw"
@@ -95,6 +96,7 @@ def handler(req):
token = sess['cobbler_token']
# needed?
+ # usage later
req.add_common_vars()
# process form and qs data, if any
@@ -103,12 +105,14 @@ def handler(req):
for x in fs.keys():
form[x] = str(fs.get(x,'default'))
+ http_port = utils.parse_settings_lame("http_port",default="80")
+
# instantiate a CobblerWeb object
cw = CobblerWeb.CobblerWeb(
apache = apache,
token = token,
base_url = "/cobbler/web/",
- server = "http://127.0.0.1/cobbler_api_rw"
+ server = "http://127.0.0.1:%s/cobbler_api_rw" % http_port
)
# check for a valid path/mode