Skip to content

Commit e8d3224

Browse files
authored
Merge pull request #32 from bengland2/issue-cleanup
resolve issues 12 and 19
2 parents 72de4a4 + e332a8e commit e8d3224

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

fallocate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ def fallocate(fd, mode, offset, length):
6161
elif sys.version.startswith('2'):
6262
ret = os.write(fd, 'hi there')
6363
else:
64-
raise Exception('unrecognized python version %s' % sys.version)
64+
print('unrecognized python version %s' % sys.version)
65+
sys.exit(NOTOK)
6566
assert ret == 8
6667
os.close(fd)
6768
print('SUCCESS')

smallfile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
import errno
4343
import codecs
4444
from shutil import rmtree
45-
from math import sqrt, log2
45+
import math
4646
from sync_files import ensure_dir_exists, ensure_deleted, write_sync_file, touch
4747

4848
OK = 0 # system call return code for success
@@ -503,7 +503,7 @@ def reset(self):
503503
self.pause_sec = self.pause_between_files / self.MICROSEC_PER_SEC
504504
# recalculate this to capture any changes in self.total_hosts and self.threads
505505
self.total_threads = self.total_hosts * self.threads
506-
self.throttling_factor = 0.1 * log2(self.total_threads + 1)
506+
self.throttling_factor = 0.1 * math.log(self.total_threads + 1, 2)
507507

508508
# to measure per-thread elapsed time
509509
self.start_time = None
@@ -1317,7 +1317,7 @@ def do_write(self, append=False, truncate=False):
13171317
raise SMFRunException('xattr module not present ' +
13181318
'but record-ctime-size specified')
13191319
if append and truncate:
1320-
raise Exception('can not append and truncate at the same time')
1320+
raise SMFRunException('can not append and truncate at the same time')
13211321

13221322
while self.do_another_file():
13231323
fn = self.mk_file_nm(self.src_dirs)

0 commit comments

Comments
 (0)