import traceback
import string
import xmlrpclib
+
from geni.util.auth import Auth
from geni.util.config import *
from geni.util.faults import *
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)
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.
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:
GENI_INTERFACE_HRN="plc"
-# API Debut
+# API Debug
# Are we logging
GENI_API_DEBUG=1
# Level1 Auth
# The hrn of the registry's level1 auth
+# xxx could be determined from hrn above
GENI_REGISTRY_LEVEL1_AUTH=""
# Hostname
# 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
# 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'
-