summaryrefslogtreecommitdiffstats
path: root/scripts
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
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')
-rwxr-xr-xscripts/index.py6
-rwxr-xr-xscripts/services.py5
2 files changed, 9 insertions, 2 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
diff --git a/scripts/services.py b/scripts/services.py
index 8fcb8f85..a820b61c 100755
--- a/scripts/services.py
+++ b/scripts/services.py
@@ -20,6 +20,7 @@ import xmlrpclib
import cgi
import os
from cobbler.services import CobblerSvc
+import cobbler.utils as utils
#=======================================
@@ -67,11 +68,13 @@ def handler(req):
form["REMOTE_ADDR"] = req.subprocess_env.get("REMOTE_ADDR",None)
form["REMOTE_MAC"] = req.subprocess_env.get("HTTP_X_RHN_PROVISIONING_MAC_0",None)
+
+ http_port = utils.parse_settings_lame("http_port",default="80")
# instantiate a CobblerWeb object
cw = CobblerSvc(
apache = apache,
- server = "http://127.0.0.1/cobbler_api"
+ server = "http://127.0.0.1:%s/cobbler_api" % http_port
)
# check for a valid path/mode