safe_makedirs will recursively create paths, just like mkdirs -p
The "safe" part is that it wont error/except if any of the paths already
exist.
Signed-off-by: Travis Rhoden <trhoden@redhat.com>
raise
+def safe_makedirs(path):
+ """ create path recursively if it doesn't exist """
+ try:
+ os.makedirs(path)
+ except OSError, e:
+ if e.errno == errno.EEXIST:
+ pass
+ else:
+ raise
+
+
def zeroing(dev):
""" zeroing last few blocks of device """
# this kills the crab