Fixed sendnodeemuid to use the handler's sendall() method instead of BaseRequestHandler's request.sendall(). Added a method to retrieve a configuration item by key.

This commit is contained in:
Rod A Santiago 2016-09-14 18:05:52 -07:00
parent 1b8c195c75
commit 9913168896

View file

@ -766,7 +766,7 @@ class Session(object):
| coreapi.CORE_API_LOC_FLAG, | coreapi.CORE_API_LOC_FLAG,
tlvdata) tlvdata)
try: try:
handler.request.sendall(reply) handler.sendall(reply)
except Exception, e: except Exception, e:
self.warn("sendall() for node: %d error: %s" % (nodenum, e)) self.warn("sendall() for node: %d error: %s" % (nodenum, e))
del handler.nodestatusreq[nodenum] del handler.nodestatusreq[nodenum]
@ -1250,6 +1250,13 @@ class SessionMetaData(ConfigurableManager):
def additem(self, key, value): def additem(self, key, value):
self.configs[key] = value self.configs[key] = value
def getitem(self, key):
try:
return self.configs[key]
except KeyError:
pass
return None
def items(self): def items(self):
return self.configs.iteritems() return self.configs.iteritems()