configure GENI_PLC_URL rather than HOST & PORT & PATH
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 1 Jul 2009 15:28:33 +0000 (15:28 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 1 Jul 2009 15:28:33 +0000 (15:28 +0000)
geni-config-tty
geni/util/api.py
geni/util/geni_config

index 8524170..44d213f 100755 (executable)
@@ -37,9 +37,7 @@ all_variables   = ["GENI_REGISTRY_ROOT_AUTH",
                    "GENI_SM_PORT",
                    "GENI_PLC_USER",
                    "GENI_PLC_PASSWORD",    
-                   "GENI_PLC_HOST",
-                   "GENI_PLC_PORT",
-                   "GENI_PLC_API_PATH"
+                   "GENI_PLC_URL",
                    ]
 usual_variables = ["GENI_REGISTRY_ROOT_AUTH",
                    "GENI_REGISTRY_LEVEL1_AUTH",
index 6bc82a6..d1c8f60 100644 (file)
@@ -8,6 +8,7 @@ import os
 import traceback
 import string
 import xmlrpclib
+
 from geni.util.auth import Auth
 from geni.util.config import *
 from geni.util.faults import *
@@ -130,10 +131,7 @@ class GeniAPI:
             return shell
         except ImportError:
             # connect via xmlrpc
-            plc_host = self.config.GENI_PLC_HOST
-            plc_port = self.config.GENI_PLC_PORT
-            plc_api_path = self.config.GENI_PLC_API_PATH
-            url = "https://%(plc_host)s:%(plc_port)s/%(plc_api_path)s/" % locals()
+            url = self.config.GENI_PLC_URL
              
             shell = xmlrpclib.Server(url, verbose = 0, allow_none = True)
             shell.AuthCheck(self.plauth)
@@ -216,7 +214,7 @@ class GeniAPI:
         return new_cred
    
 
-    def loadCredential(self):
+    def loadCredential (self):
         """
         Attempt to load credential from file if it exists. If it doesnt get
         credential from registry.
@@ -521,6 +519,8 @@ class GeniAPI:
             elif interface == SOAPpy:
                 result = faultParameter(NS.ENV_T + ":Server", "Method Failed", method)
                 result._setDetail("Fault %d: %s" % (fault.faultCode, fault.faultString))
+            else:
+                raise
 
         # Return result
         if interface == xmlrpclib:
index 675d9dc..10d617b 100644 (file)
@@ -6,7 +6,7 @@ GENI_BASE_DIR="/usr/share/geniwrapper/"
 GENI_INTERFACE_HRN="plc"   
 
 
-# API Debut
+# API Debug
 # Are we logging
 GENI_API_DEBUG=1
 
@@ -22,6 +22,7 @@ GENI_REGISTRY_ROOT_AUTH="plc"
 
 # Level1 Auth
 # The hrn of the registry's level1 auth
+# xxx could be determined from hrn above
 GENI_REGISTRY_LEVEL1_AUTH=""
 
 # Hostname
@@ -61,7 +62,7 @@ GENI_SM_HOST="localhost"
 # Geni slice manager server port  
 GENI_SM_PORT=12347
 
-# PLC Interace Access Configuration
+# PLC Interface Access Configuration
 #
 # PLC user
 # Valid plc account geni interfaces will use for plc requests   
@@ -74,18 +75,9 @@ GENI_PLC_PASSWORD='root'
 
 # Hostname
 # Fully qualified hostname of PLC interface
-GENI_PLC_HOST='localhost'
-
-# Port
-# Port of PLC interface
-GENI_PLC_PORT=443
-
-# API Path
-# Path of PLC api interface 
-GENI_PLC_API_PATH='PLCAPI'
+GENI_PLC_URL='https://localhost:443/PLCAPI/'
 
 # PLC Shell PATH
 # Path of PLC shell. This only applies if Geni interfaces and PLC interface are running on the same 
 # machine
 GENI_PLC_SHELL_PATH='/usr/share/plc_api'
-