18994 python event support is not complete osol_175a s11u1_1 s11u1_2 s11u1_3 s11u1_4 s11u1_5 s11u1_6 s11u1_7
authorGary Pennington <gary.pennington@oracle.com>
Thu, 06 Oct 2011 06:26:04 -0700
changeset 777 6ea3437d9ff6
parent 776 967632172269
child 778 b98dd4a9a785
18994 python event support is not complete
usr/src/lib/pyrad/client.py
--- a/usr/src/lib/pyrad/client.py	Wed Oct 05 11:47:20 2011 -0400
+++ b/usr/src/lib/pyrad/client.py	Thu Oct 06 06:26:04 2011 -0700
@@ -725,6 +725,10 @@
 	self._stability = unpacker.unpack_enum()
 	self._type = types.typeref(unpacker)
 
+    def read(self, instance):
+	up = xdrlib.Unpacker(instance._payload)
+	return self._type.read(up, True)
+
 class RadApiVersion(object):
     def __init__(self, unpacker):
         stabilities = 'undefined', 'private', 'uncommitted', 'committed'
@@ -765,6 +769,14 @@
 	    raise InvalidFeatureError(instance._name,
 		"%s has no attribute %s" % (instance._name, attr))
 
+    def read_event(self):
+	instance = self._connection.read_event()
+	try:
+		return self._events[instance._event].read(instance)
+	except KeyError:
+		raise InvalidFeatureError(instance._name,
+		    "%s has no event %s" % (instance._name, event))
+
     def write(self, instance, attr, value):
 	try:
 	    self._attributes[attr].write(instance, value)