summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorKang Kai <kai.kang@windriver.com>2012-06-06 17:52:24 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-08 12:13:16 +0100
commit0b6bb93558e0f73a743726ff326511dbcda90d4b (patch)
tree9129c6a0bfb373490c0766db14a7fe06b5c576d0 /bitbake
parentac7b96420aeaa3534d51e2d61b2d8ecca008bd11 (diff)
downloadpoky-0b6bb93558e0f73a743726ff326511dbcda90d4b.tar.gz
ui/crumbs/hig.py: fix run time error
Commit 094742bed2fc01d55f572da946fcfa7a48521401 re-implement the function popen_read(). If there is no USB device, it crashes with "ExecutionError: Execution of 'ls /dev/disk/by-id/usb*' failed with exit code 2:" Replace popen_read() way with glob module to get the USB devices. (Bitbake rev: 0c43fe72e3c6a12ac19173d8cbbad81af21c2d85) Signed-off-by: Kang Kai <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py
index f64f1be46c..3ca838279d 100644
--- a/bitbake/lib/bb/ui/crumbs/hig.py
+++ b/bitbake/lib/bb/ui/crumbs/hig.py
@@ -20,6 +20,7 @@
20# with this program; if not, write to the Free Software Foundation, Inc., 20# with this program; if not, write to the Free Software Foundation, Inc.,
21# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 21# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 22
23import glob
23import gtk 24import gtk
24import gobject 25import gobject
25import hashlib 26import hashlib
@@ -806,7 +807,7 @@ class DeployImageDialog (CrumbsDialog):
806 807
807 def find_all_usb_devices(self): 808 def find_all_usb_devices(self):
808 usb_devs = [ os.readlink(u) 809 usb_devs = [ os.readlink(u)
809 for u in self.popen_read('ls /dev/disk/by-id/usb*').split() 810 for u in glob.glob('/dev/disk/by-id/usb*')
810 if not re.search(r'part\d+', u) ] 811 if not re.search(r'part\d+', u) ]
811 return [ '%s' % u[u.rfind('/')+1:] for u in usb_devs ] 812 return [ '%s' % u[u.rfind('/')+1:] for u in usb_devs ]
812 813