diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-05-06 10:39:59 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-05-06 10:39:59 -0700 |
commit | 404f8f0494ab5fd2ff947bf82d085fed52c126c5 (patch) | |
tree | 08942f40ba3acb0ebe644099f84c88de991f63de | |
parent | 246670205503b6bcd91130325d2d9050fb7b74e5 (diff) |
don't abort upgrade if a RADIUS server is unreachable
-rw-r--r-- | FS/FS/part_export/sqlradius.pm | 7 |
1 files changed, 6 insertions, 1 deletions
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'). |