projects
/
tools
/
mic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
53c4d1d
)
avoid IndexError for loopdev assigning
author
Gui Chen
<gui.chen@intel.com>
Tue, 10 Sep 2013 08:34:27 +0000
(
04:34
-0400)
committer
Gui Chen
<gui.chen@intel.com>
Tue, 10 Sep 2013 08:37:02 +0000
(
04:37
-0400)
when 'losetup -f' returns '' output,
out.split()[0] will raise IndexError
Fixes: #1094
Change-Id: Iad310d70defc3c8a83c221951f0d3f8e6dc5a8a6
Signed-off-by: Gui Chen <gui.chen@intel.com>
mic/utils/fs_related.py
patch
|
blob
|
history
diff --git
a/mic/utils/fs_related.py
b/mic/utils/fs_related.py
index
ed193f7
..
b3f6110
100644
(file)
--- a/
mic/utils/fs_related.py
+++ b/
mic/utils/fs_related.py
@@
-942,7
+942,7
@@
def get_loop_device(losetupcmd, lofile):
# provide an avaible loop device
rc, out = runner.runtool([losetupcmd, "--find"])
- if rc == 0:
+ if rc == 0
and out
:
loopdev = out.split()[0]
devinst.register(loopdev)
if not loopdev or not os.path.exists(loopdev):