Defer use of Net::OpenSRS so that failure to install the module doesn't stop
[freeside.git] / FS / FS / part_export / domreg_opensrs.pm
index 5d5c595..df8b400 100644 (file)
@@ -7,7 +7,6 @@ use FS::Conf;
 use FS::part_export::null;
 use FS::svc_domain;
 use FS::part_pkg;
-use Net::OpenSRS;
 
 =head1 NAME
 
@@ -193,6 +192,9 @@ sub _export_insert {
 
   return if $svc_domain->action eq 'I';  # Ignoring registration, just doing DNS
 
+  eval "use Net::OpenSRS;";
+  return $@ if $@;
+
   # Get the TLD of the new domain
   my @bits = split /\./, $svc_domain->domain;