provegard/diskgraph — Issue #1: Failure when pvs command not found
Author: provegard
Created: 2011-12-30 23:49:15+00:00
State: open

When LVM commands are not installed, diskgraph fails with the following error:

```
Traceback (most recent call last):
File "diskgraph/dgmain.py", line 109, in
main(sys.argv[1])
File "diskgraph/dgmain.py", line 88, in main
dg = DiskGraph(SysInfo())
File "/home/per/projects/diskgraph/diskgraph/sysinfo.py", line 167, in __init__
self.lvm_pvs = LvmPvs()
File "/home/per/projects/diskgraph/diskgraph/sysinfo.py", line 139, in __init__
lines = list(exec_cmd("pvs --noheadings -o pv_name,pv_size --units b --nosuffix".split(" ")))
File "/home/per/projects/diskgraph/diskgraph/sysinfo.py", line 42, in exec_cmd
return (re.split(" +", line.strip()) for line in subprocess.check_output(args).split("\n") if line != "")
File "/usr/lib64/python2.7/subprocess.py", line 537, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/lib64/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1228, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
```