Patch to not crash when connman-plugin-fake is installed
Posted by misc on 2009-12-01 20:28
While testing mokonnect on shr-unstable, I faced several errors. I found the root cause being connman-plugin-fake being installed, because I did a wrong cut and paste.
The plugin create a fake empty device :
root@nivmizzet:~# mdbus -s org.moblin.connman /device/fake org.moblin.connman.Device.GetProperties
{ 'Networks': [op'/device/fake/network_two', op'/device/fake/network_one'],
'Powered': True}
Here is a patch that prevent such error and that make code more robust, by catching KeyError and ignoring it when searching for wifi device.
Using try: except: clause without specifying the exact type of exception is often not good, because this tend to mask problem.
The patch is against latest svn.
The plugin create a fake empty device :
root@nivmizzet:~# mdbus -s org.moblin.connman /device/fake org.moblin.connman.Device.GetProperties
{ 'Networks': [op'/device/fake/network_two', op'/device/fake/network_one'],
'Powered': True}
Here is a patch that prevent such error and that make code more robust, by catching KeyError and ignoring it when searching for wifi device.
Using try: except: clause without specifying the exact type of exception is often not good, because this tend to mask problem.
The patch is against latest svn.
Home / Developer API / Tour / Get a Project - Solutions for Bug & Issue Tracking, Collaboration Tools, Subversion Hosting, Git Hosting
Shrdev is powered by Assembla.
1 Comments
By misc on 2009-12-01 20:29