From: Thierry Parmentelat Date: Wed, 1 Jul 2009 15:28:33 +0000 (+0000) Subject: configure GENI_PLC_URL rather than HOST & PORT & PATH X-Git-Tag: sfa-0.9-0@14641~230 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=e8a218d47c7ddefc8b67eb0087c05aff795bd59c;p=sfa.git configure GENI_PLC_URL rather than HOST & PORT & PATH --- diff --git a/geni-config-tty b/geni-config-tty index 85241703..44d213ff 100755 --- a/geni-config-tty +++ b/geni-config-tty @@ -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", diff --git a/geni/util/api.py b/geni/util/api.py index 6bc82a69..d1c8f608 100644 --- a/geni/util/api.py +++ b/geni/util/api.py @@ -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: diff --git a/geni/util/geni_config b/geni/util/geni_config index 675d9dcd..10d617b4 100644 --- a/geni/util/geni_config +++ b/geni/util/geni_config @@ -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' -