Blame SOURCES/hplip-avahi-parsing.patch

b99885
diff -up hplip-3.15.2/base/avahi.py.parsing hplip-3.15.2/base/avahi.py
b99885
--- hplip-3.15.2/base/avahi.py.parsing	2015-02-04 15:43:37.662551377 +0100
b99885
+++ hplip-3.15.2/base/avahi.py	2015-02-04 15:45:56.576564858 +0100
b99885
@@ -52,9 +52,14 @@ def detectNetworkDevices(ttl=4, timeout=
b99885
                              'status_code': 0, 'device2': '0', 'device3': '0', 'note': ''}
b99885
                         y['ip'] = ip
b99885
                         y['hn'] = bits[6].replace('.local', '')
b99885
-                        details = bits[9].split('" "')
b99885
+                        details = bits[9].rstrip ().strip ('"').split('" "')
b99885
                         for item in details:
b99885
                             key, value = item.split('=', 1)
b99885
+                            keyvalue = item.split('=', 1)
b99885
+                            if len (keyvalue) < 2:
b99885
+                                # Skip parts that don't match key=value
b99885
+                                continue
b99885
+                            key, value = keyvalue
b99885
                             if key == 'ty':
b99885
                                 y['mdns'] = value
b99885
                                 y['device1'] = "MFG:Hewlett-Packard;MDL:%s;CLS:PRINTER;" % value