From 404f8f0494ab5fd2ff947bf82d085fed52c126c5 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sun, 6 May 2012 10:39:59 -0700 Subject: [PATCH] don't abort upgrade if a RADIUS server is unreachable --- FS/FS/part_export/sqlradius.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/FS/FS/part_export/sqlradius.pm b/FS/FS/part_export/sqlradius.pm index 910346bea..57bbdb439 100644 --- a/FS/FS/part_export/sqlradius.pm +++ b/FS/FS/part_export/sqlradius.pm @@ -1154,8 +1154,13 @@ sub _upgrade_exporttype { sub import_attrs { my $self = shift; - my $dbh = sqlradius_connect( map $self->option($_), + my $dbh = DBI->connect( map $self->option($_), qw( datasrc username password ) ); + unless ( $dbh ) { + warn "Error connecting to RADIUS server: $DBI::errstr\n"; + return; + } + my $usergroup = $self->option('usergroup') || 'usergroup'; my $error; warn "Importing RADIUS groups and attributes from ".$self->option('datasrc'). -- 2.11.0