From 4ea4f33a6a0382249996c4dae4db31ae2e059dbb Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Thu, 28 Feb 2008 21:46:21 +0000 Subject: [PATCH] follow hotplug-ng changes --- .../Plugins/SystemPlugins/Hotplug/plugin.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py index 882668f7..89e536ba 100644 --- a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py +++ b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py @@ -21,18 +21,24 @@ class Hotplug(Protocol): def connectionLost(self, reason): data = self.received.split('\0')[:-1] - print "hotplug:", data + v = {} - if len(data) < 4: - return + for x in data: + i = x.find('=') + var, val = x[:i], x[i+1:] + v[var] = val - (action, device, physdev, driver) = data[:4] + print "hotplug:", v + + action = v.get("ACTION") + device = v.get("DEVPATH") + physdevpath = v.get("PHYSDEVPATH") dev = device.split('/')[-1] if action == "add": print "Medium found in", self.getUserfriendlyDeviceName(dev) - harddiskmanager.addHotplugPartition(dev, self.getUserfriendlyDeviceName(dev)) + harddiskmanager.addHotplugPartition(dev, self.getUserfriendlyDeviceName(physdevpath)) elif action == "remove": harddiskmanager.removeHotplugPartition(dev) -- 2.30.2