commit 891dfdff1e8ec0e3991a66ead62f2d8db1b9744e
Author: Dave Riches <dcr226(a)fedorapeople.org>
Date: Tue Jan 11 14:12:28 2011 +0000
added check_device() , checks to see if the device is already mounted/busy. if so, it
exits
multiboot-media-creator.py | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/multiboot-media-creator.py b/multiboot-media-creator.py
index 5793212..8535c31 100755
--- a/multiboot-media-creator.py
+++ b/multiboot-media-creator.py
@@ -14,7 +14,7 @@
### Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
### multiboot-media-creator Copyright 2010-2011 Robert 'Bob' Jensen
<bob(a)fedoraunity.org>, Dave Riches <dcr226(a)fedorapeople.org>, Dennis Johnson
<drjohnson1(a)gmail.com>, Ben Williams <vaioof(a)yahoo.com>
-import sys, os, glob, tempfile, shutil
+import sys, os, glob, tempfile, shutil, parted
__version__ = "$Revision: 4 $"
# $Source$
@@ -58,6 +58,13 @@ if dev==None:
print path
print dev
+def check_device():
+ devinfo=parted.getDevice(dev)
+ if devinfo.busy==True:
+ sys.exit("The device is busy or already mounted, please check and try
again")
+ else:
+ print "Device not busy, continuing"
+
def mount_device(dev):
os.system("mount %s %s" % (dev, mytemp))
@@ -129,7 +136,7 @@ def build_filesystem():
if options.rsync==False:
shutil.copytree(tree_path,os.path.join(mytemp, BN,"images/"))
else:
- os.system("rsync -avH --progress %s %s" %
(tree_path,os.path.join(mytemp, BN,"images/"))
+ os.system("rsync -avH --progress %s %s" %
(tree_path,os.path.join(mytemp, BN,"images/")))
umount_iso(i)
except:
print "No live isos found"
Show replies by date