From 317a4f1532e18b7a3e3a70ee609bc8c720af9949 Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Mon, 13 Apr 2009 04:38:05 +0000 Subject: [PATCH] Looks like the 'who' packet doesn't have a target element in the target@destination segment of the packet. Handle this semi-intelligently when ran into. --- src/imc2/packets.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/imc2/packets.py b/src/imc2/packets.py index c62c3da4a1..f4b45c40b3 100644 --- a/src/imc2/packets.py +++ b/src/imc2/packets.py @@ -74,7 +74,14 @@ class IMC2Packet(object): target_destination = token split_target_destination = target_destination.split('@') self.target = split_target_destination[0] - self.destination = split_target_destination[1] + try: + self.destination = split_target_destination[1] + except IndexError: + # There is only one element to the target@dest segment + # of the packet. Wipe the target and move the captured + # value to the destination attrib. + self.target = '*' + self.destination = split_target_destination[0] elif counter > 4: # Populate optional data. key, value = token.split('=', 1)