Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pvshrink
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ while True:
used_blocks = []

try:
pvs = subprocess.check_output(['pvs','--segments','-o','lv_name,pv_segstart,pv_segsize','--separator',',','--noheadings',device])
pvs = subprocess.check_output(['pvs','--segments','-o','lv_name,pv_segstart,pv_segsize','--separator',',','--noheadings',device]).decode('utf-8')
except subprocess.CalledProcessError as exc:
die("Error calling pvs (%d)" % exc.returncode)

Expand Down Expand Up @@ -113,7 +113,7 @@ while True:
total_segments_moved = total_segments_moved + size
print("%d of %d (%.2f%%) done" % (total_segments_moved, total_segments_to_move, 100*float(total_segments_moved)/float(total_segments_to_move)))

pvck = subprocess.check_output(['pvck', device])
pvck = subprocess.check_output(['pvck', device]).decode('utf-8')

match = re.search(r'Found text metadata area: offset=(\d+), size=(\d+)', pvck)
if match is None:
Expand All @@ -123,7 +123,7 @@ if match is None:
metadata_size = int(match.group(1)) + int(match.group(2))
print("Metadata size: %d b" % metadata_size)

pvdisplay = subprocess.check_output(['pvdisplay','--units','b', device])
pvdisplay = subprocess.check_output(['pvdisplay','--units','b', device]).decode('utf-8')

match = re.search(r'PE Size\s*(\d+)', pvdisplay)
if match is None:
Expand Down