#2486 Fix if protocol, register options are not present in wapmconf.json file.
--- a/runtime/WampClient.py Tue Apr 10 12:08:23 2018 +0200
+++ b/runtime/WampClient.py Wed Apr 11 10:53:48 2018 +0200
@@ -103,13 +103,15 @@
global _WampSession
_WampSession = self
ID = self.config.extra["ID"]
+ validRegisterOptions = {}
registerOptions = self.config.extra.get('registerOptions', None)
- arguments = inspect.getargspec(types.RegisterOptions.__init__).args
- validRegisterOptions = getValidOptins(registerOptions, arguments)
- if validRegisterOptions:
- registerOptions = types.RegisterOptions(**validRegisterOptions)
- #print(_("Added custom register options"))
+ if registerOptions:
+ arguments = inspect.getargspec(types.RegisterOptions.__init__).args
+ validRegisterOptions = getValidOptins(registerOptions, arguments)
+ if validRegisterOptions:
+ registerOptions = types.RegisterOptions(**validRegisterOptions)
+ #print(_("Added custom register options"))
for name in ExposedCalls:
yield self.register(GetCallee(name), u'.'.join((ID, name)), registerOptions)
@@ -140,11 +142,12 @@
WampWebSocketClientFactory.__init__(self, *args, **kwargs)
protocolOptions = config.extra.get('protocolOptions', None)
- arguments = inspect.getargspec(self.setProtocolOptions).args
- validProtocolOptions = getValidOptins(protocolOptions, arguments)
- if validProtocolOptions:
- self.setProtocolOptions(**validProtocolOptions)
- #print(_("Added custom protocol options"))
+ if protocolOptions:
+ arguments = inspect.getargspec(self.setProtocolOptions).args
+ validProtocolOptions = getValidOptins(protocolOptions, arguments)
+ if validProtocolOptions:
+ self.setProtocolOptions(**validProtocolOptions)
+ #print(_("Added custom protocol options"))
def buildProtocol(self, addr):
self.resetDelay()