- rv = call(["/sbin/lvresize", "-L", size + "M", lvpath])
- if rv != 0:
- print >>sys.stderr, "Error resizing LV %s\n" %(lvname,)
+ p = Popen(["/sbin/lvresize", "-L", size + "M", lvpath],
+ stdin=PIPE, stderr=PIPE)
+ print >> p.stdin, 'y'
+ err = p.stderr.read()
+ if p.wait() != 0 and 'matches existing size' not in err:
+ print >> sys.stderr, "Error resizing LV %s:\n" %(lvname,)
+ print >> sys.stderr, err