[Sysmonitor] sysmonitor screenlet fails to find the computer's IP address
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Individual Screenlets |
Fix Released
|
Low
|
Unassigned | ||
indiv-screenlets (Ubuntu) |
Fix Released
|
Low
|
Julien Lavergne |
Bug Description
Binary package hint: screenlets
Using Ubuntu 10.04.1 with screenlets 0.1.2-7ubuntu1
The screenlet sysmonitor doesn't return an IP address but an empty string. This is due to a bug in the function net_get_ip().
Here is the content of the function screenlets.
def net_get_ip(): # by Whise
442 """Returns ip if it can"""
443 ip = commands.
444 x = 0
445 while True:
446 ip = ip[ip.find("inet addr:"):]
447 ip = ip[10:]
448 ipc = ip[:ip.
449 if ipc != '127.0.0.1' and ipc != None and ipc !='1':
450
451 return ipc
452
453
454 return _('Cannot get ip')
There is an error on line 446. The ifconfig command doesn't return a string "inet addr" but "inet adr" instead (only one 'd').
Because of this, the function doesn't return the ip address but an empty string.
To correct the problem, lines 446 and 447 must be changed to this:
446 ip = ip[ip.find("inet adr:"):]
447 ip = ip[9:]
This bug might or might not be related to this one:
bug #241557 - screenlets.
Changed in screenlets (Ubuntu): | |
assignee: | nobody → Julien Lavergne (gilir) |
Changed in screenlets (Ubuntu): | |
status: | Incomplete → In Progress |
assignee: | nobody → Julien Lavergne (gilir) |
tags: | added: patch |
affects: | screenlets → indiv-screenlets |
summary: |
- sysmonitor screenlet fails to find the computer's IP address + [Sysmonitor] sysmonitor screenlet fails to find the computer's IP + address |
Changed in screenlets (Ubuntu): | |
status: | Triaged → In Progress |
assignee: | nobody → Julien Lavergne (gilir) |
affects: | screenlets (Ubuntu) → indiv-screenlets (Ubuntu) |
Changed in indiv-screenlets (Ubuntu): | |
status: | In Progress → Fix Released |
Changed in indiv-screenlets: | |
status: | Fix Committed → Fix Released |
Thank you for your bug report and the proposed fix. Could you try with the screenlets package in my PPA : https:/ /launchpad. net/~gilir/ +archive/ unstable and report back if the problem is fixed for you ?