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:
3c6d788
)
avoid invalid literal in genloopid
author
Gui Chen
<gui.chen@intel.com>
Fri, 15 Jun 2012 01:57:47 +0000
(09:57 +0800)
committer
Gui Chen
<gui.chen@intel.com>
Fri, 15 Jun 2012 01:57:47 +0000
(09:57 +0800)
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
1063763
..
741e937
100644
(file)
--- a/
mic/utils/fs_related.py
+++ b/
mic/utils/fs_related.py
@@
-823,9
+823,9
@@
class LoopDevice(object):
def _genloopid(self):
import glob
+ fint = lambda x: x[9:].isdigit() and int(x[9:]) or 0
maxid = 1 + max(filter(lambda x: x<100,
- map(lambda x: int(x[9:]),
- glob.glob("/dev/loop[0-9]*"))))
+ map(fint, glob.glob("/dev/loop[0-9]*"))))
if maxid < 10: maxid = 10
if maxid >= 100: raise
return maxid