diff --git a/xCAT-server/lib/xcat/Confluent/Client.pm b/xCAT-server/lib/xcat/Confluent/Client.pm index 390f9ce82..c1b4e9208 100644 --- a/xCAT-server/lib/xcat/Confluent/Client.pm +++ b/xCAT-server/lib/xcat/Confluent/Client.pm @@ -87,7 +87,7 @@ sub ssl_connect { } $self->{handle} = IO::Socket::SSL->new(%sslargs); unless ($self->{handle}) { - die "Unable to reach target, $SSL_ERROR/$!"; + return undef; } } @@ -107,7 +107,7 @@ sub new { $self->{handle} = $self->ssl_connect($serverlocation, @_); } unless ($self->{handle}) { - die "General failure connecting $!"; + return undef; } $self->{server} = Confluent::TLV->new($self->{handle}); my $banner = $self->{server}->recv(); diff --git a/xCAT-server/lib/xcat/plugins/confluent.pm b/xCAT-server/lib/xcat/plugins/confluent.pm index a46c4f8ce..07349fbfd 100644 --- a/xCAT-server/lib/xcat/plugins/confluent.pm +++ b/xCAT-server/lib/xcat/plugins/confluent.pm @@ -201,6 +201,13 @@ sub makeconfluentcfg { my $svboot=0; if (exists($req->{svboot})) { $svboot=1;} my $confluent = Confluent::Client->new(); # just the local form for now.. + unless ($confluent) { + # unable to get a connection to confluent + my $rsp; + $rsp->{data}->[0] = "Unable to open a connection to confluent, verify that confluent is running."; + xCAT::MsgUtils->message("E", $rsp, $cb); + return; + } my $isSN=xCAT::Utils->isServiceNode(); my @hostinfo=xCAT::NetworkUtils->determinehostname();