Deal with systems with no interface support

This commit is contained in:
Jamie Cameron
2012-10-16 22:19:07 -07:00
parent 3d038470ac
commit 1c4da2a310
2 changed files with 6 additions and 6 deletions

View File

@ -277,12 +277,16 @@ return $out;
sub list_iscsi_ifaces
{
&clean_language();
my $errtemp = &transname();
my $out = &backquote_command(
"$config{'iscsiadm'} -m iface -o show -P 1 2>/dev/null");
"$config{'iscsiadm'} -m iface -o show -P 1 2>$errtemp");
&reset_environment();
my @lines = split(/\r?\n/, $out);
my $err = &read_file_contents($errtemp);
if ($?) {
return $lines[0];
return "Interfaces are not supported by this OpenISCSI version"
if ($err =~ /Invalid\s+info\s+level/);
return $err || $lines[0];
}
my @rv;
my ($iface, $target);

View File

@ -65,10 +65,6 @@ if (ref($ifaces)) {
[ [ undef, "<".$text{'conns_ifacedef'}.">" ],
map { $_->{'name'} } @$ifaces ]));
}
else {
print &ui_table_row($text{'conns_iface'},
&text('conns_ifaceerr', $ifaces));
}
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'conns_start'} ] ]);