[cig-commits] r8233 - cs/portal/trunk

leif at geodynamics.org leif at geodynamics.org
Wed Nov 7 15:54:02 PST 2007


Author: leif
Date: 2007-11-07 15:54:01 -0800 (Wed, 07 Nov 2007)
New Revision: 8233

Modified:
   cs/portal/trunk/daemon.py
Log:
Enable the daemon to communicate with the portal via HTTPS.
Currently, setting 'scheme' to 'https' requires one to also set
'download-input-files' to 'True' (causing the daemon to stage-in input
files via the GASS server) since Globus RSL cannot handle 'https'
URLs, and the URLs the daemon hands to Globus cannot be independently
configured.


Modified: cs/portal/trunk/daemon.py
===================================================================
--- cs/portal/trunk/daemon.py	2007-11-07 22:00:32 UTC (rev 8232)
+++ cs/portal/trunk/daemon.py	2007-11-07 23:54:01 UTC (rev 8233)
@@ -554,7 +554,12 @@
     def post(self, body, headers, url):
         self.info.log("POST %s" % url)
         import httplib
-        conn = httplib.HTTPConnection(self.portal.host)
+        if self.portal.scheme == "http":
+            conn = httplib.HTTPConnection(self.portal.host)
+        elif self.portal.scheme == "https":
+            conn = httplib.HTTPSConnection(self.portal.host)
+        else:
+            assert False # not scheme in ["http", "https"]
         conn.request("POST", url, body, headers)
         response = conn.getresponse()
         data = response.read()
@@ -584,11 +589,12 @@
     name = "web-portal"
 
     import pyre.inventory as pyre
+    scheme   = pyre.str("scheme", validator=pyre.choice(["http", "https"]), default="http")
     host     = pyre.str("host", default="localhost:8000")
     urlRoot  = pyre.str("url-root", default="/specfem3dglobe/")
 
     def _configure(self):
-        self.urlPrefix           = 'http://%s%s' % (self.host, self.urlRoot)
+        self.urlPrefix           = '%s://%s%s' % (self.scheme, self.host, self.urlRoot)
         self.inputFileUrl        = self.urlPrefix + 'simulations/%d/%s'
         # runs
         self.runsUrl             = self.urlPrefix + 'runs/list.py'



More information about the cig-commits mailing list