- lvr = subprocess.Popen(['lvchange', '-an', "xenvg/%s" % (src,)],
- stderr=subprocess.PIPE,
- stdout=getOutput()['stdout'])
- ret = lvr.wait()
-
- if ret:
- if verbosity > 0:
- print lvr.stderr.read()
- return ret
-
- lvr = subprocess.Popen(['lvrename', "xenvg/%s" % (src,), "xenvg/%s" % (dest,)],
- stderr=subprocess.PIPE,
- stdout=getOutput()['stdout'])
- ret = lvr.wait()
+ subprocess.run(['lvchange', '-an', f'xenvg/{src}'],
+ check_output=True, encoding='utf-8', check=True)