xend: Discard error messages of lsscsi

In the case of a host OS without lsscsi command, the following
error message is recorded into xend-debug.log when xend is started.
The error message is recorded once certainly.  If SCSI devices are
connected to the host OS, it is recorded to the number of SCSI
devices.

  sh: lsscsi: command not found

This patch discards the error message to /dev/null.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
This commit is contained in:
Keir Fraser committed 2009-03-11 10:14:33 +00:00
1 parent 0b384c185a
commit ce205e72b5
1 file changed
+2 -2
+2 -2
View File
@@ -90,7 +90,7 @@ def _vscsi_get_scsidevices_by_lsscsi(option = ""):
devices = []
for scsiinfo in os.popen('lsscsi -g %s' % option).readlines():
for scsiinfo in os.popen('lsscsi -g %s 2>/dev/null' % option).readlines():
s = scsiinfo.split()
hctl = s[0][1:-1]
try:
@@ -248,7 +248,7 @@ def get_all_scsi_devices():
get_scsi_scsilevel(scsi_dev['physical_HCTL'])
try:
lsscsi_info = os.popen('lsscsi ' + scsi_dev['physical_HCTL']).read().split()
lsscsi_info = os.popen('lsscsi %s 2>/dev/null' % scsi_dev['physical_HCTL']).read().split()
scsi_dev['type'] = lsscsi_info[1]
except:
scsi_dev['type'] = None
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.