"""
assert os.path.exists(dev)
dev = os.path.realpath(dev)
- base = dev[5:]
+ base = dev.split('/')[-1]
# full disk?
directory = '/sys/block/{base}/holders'.format(base=base)
try:
if not disk.startswith('/dev/') or not stat.S_ISBLK(os.lstat(path).st_mode):
return False
- base = disk[5:]
+ base = disk.split('/')[-1]
while len(base):
if os.path.exists(SUPPRESS_PREFIX + base):
return True
raise Error('does not exist', path)
if not stat.S_ISBLK(os.lstat(path).st_mode):
raise Error('not a block device', path)
- base = disk[5:]
+ base = disk.split('/')[-1]
with file(SUPPRESS_PREFIX + base, 'w') as f:
pass
if not stat.S_ISBLK(os.lstat(path).st_mode):
raise Error('not a block device', path)
assert disk.startswith('/dev/')
- base = disk[5:]
+ base = disk.split('/')[-1]
fn = SUPPRESS_PREFIX + base
if not os.path.exists(fn):