projects
/
snf-image-creator
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add man pages for snf-image-creator & snf-mkimage
[snf-image-creator]
/
image_creator
/
util.py
diff --git
a/image_creator/util.py
b/image_creator/util.py
index
1cd97ff
..
8730143
100644
(file)
--- a/
image_creator/util.py
+++ b/
image_creator/util.py
@@
-35,6
+35,7
@@
import sys
import sh
import hashlib
import time
import sh
import hashlib
import time
+import os
class FatalError(Exception):
class FatalError(Exception):
@@
-73,6
+74,11
@@
def try_fail_repeat(command, *args):
raise FatalError("Command: `%s %s' failed" % (command, " ".join(args)))
raise FatalError("Command: `%s %s' failed" % (command, " ".join(args)))
+def free_space(dirname):
+ stat = os.statvfs(dirname)
+ return stat.f_bavail * stat.f_frsize
+
+
class MD5:
def __init__(self, output):
self.out = output
class MD5:
def __init__(self, output):
self.out = output