diff options
author | mark <mark> | 2011-03-22 21:03:09 +0000 |
---|---|---|
committer | mark <mark> | 2011-03-22 21:03:09 +0000 |
commit | e9bfb3af6db5f76f378f46e6367a8a932a4824bf (patch) | |
tree | a8b38898711b66abc3841bcc8c7c87cc66325b15 /FS/FS/part_export/acct_google.pm | |
parent | 5d621f40627cdfcb75b1254bd07bb02d59e9a767 (diff) |
load modules correctly for acct_google
Diffstat (limited to 'FS/FS/part_export/acct_google.pm')
-rw-r--r-- | FS/FS/part_export/acct_google.pm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/FS/FS/part_export/acct_google.pm b/FS/FS/part_export/acct_google.pm index f7a1181..c64d293 100644 --- a/FS/FS/part_export/acct_google.pm +++ b/FS/FS/part_export/acct_google.pm @@ -3,6 +3,7 @@ package FS::part_export::acct_google; use strict; use vars qw(%info %SIG $CACHE); use Tie::IxHash; + use base 'FS::part_export'; tie my %options, 'Tie::IxHash', @@ -151,16 +152,23 @@ sub google_request { sub google_handle { my $self = shift; - my $class = 'REST::Google::Apps::Provisioning'; my %opt = @_; - eval "use $class"; - - die "failed to load $class\n" if $@; + my @class = ( + 'REST::Google::Apps::Provisioning', + 'Cache::FileCache', + 'LWP::UserAgent 5.815', + ); + foreach (@class) { + eval "use $_"; + die "failed to load $_\n" if $@; + } $CACHE ||= new Cache::FileCache( { 'namespace' => __PACKAGE__, 'cache_root' => "$FS::UID::cache_dir/cache.$FS::UID::datasrc", } ); - my $google = $class->new( 'domain' => $self->option('domain') ); + my $google = REST::Google::Apps::Provisioning->new( + 'domain' => $self->option('domain') + ); # REST::Google::Apps::Provisioning lacks error reporting. We deal # with that by hooking HTTP::Response to throw a useful fatal error |