[ewg] [PATCH] ibstatus - small script change
Hal Rosenstock
hrosenstock at xsigo.com
Tue Feb 19 10:02:24 PST 2008
On Tue, 2008-02-12 at 16:33 -0800, Jeremy Brown wrote:
> The ibstatus script, in infiniband-diags, doesn't tolerate a missing
> device very well. This small fix makes the output a bit more useful.
Not sure this was seen.
Proper email list for patch is general rather than ewg.
Maintainer is Sasha Khapyorsky <sashak at voltaire.com>
-- Hal
>
> Before: $ ibstatus
> /usr/bin/ibstatus: line 60: cd: /sys/class/infiniband: No such file or directory
> Fatal error: device '8cpu-mdout.8hoursamber8-8hr-2007-09-06-01:52:23': sys
> files not found
> (/sys/class/infiniband/8cpu-mdout.8hoursamber8-8hr-2007-09-06-01:52:23/ports)
>
> After: $ ibstatus
> Fatal error: No devices
>
> Thanks for considering this!
>
> Jeremy
>
> --- infiniband-diags-1.3.5-orig/scripts/ibstatus 2008-02-07 02:35:43.000000000 -0800
> +++ infiniband-diags-1.3.5/scripts/ibstatus 2008-02-12 15:50:58.000000000 -0800
> @@ -42,7 +42,7 @@
> fi
>
> if [ "$2" = "+" ]; then
> - ports=`(cd "$infiniband_base/$1/ports"; echo *)`
> + ports=`(cd "$infiniband_base/$1/ports" 2>/dev/null || fatal No devices; echo *)`
> else
> ports=$2
> fi
> @@ -57,7 +57,7 @@
> fi
>
> if [ -z "$1" ]; then
> - cd $infiniband_base
> + cd $infiniband_base 2>/dev/null || fatal No devices
> for dev in *; do
> ib_status $dev "+";
> done
>
>
> _______________________________________________
> ewg mailing list
> ewg at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg
More information about the ewg
mailing list