diff options
author | Mark Wells <mark@freeside.biz> | 2015-12-30 18:51:09 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-12-30 18:52:11 -0800 |
commit | c565f9d78ae95bf3a4dc051e3bfbd356d9f4ff38 (patch) | |
tree | 9358435232a6d61372f6c362198cbd8bc5c93794 /FS/FS/svc_Common.pm | |
parent | 8d41520e7b5f1b54ae321d8c2de25249a2856833 (diff) |
add option for exports to avoid suspending services, #20739
Diffstat (limited to 'FS/FS/svc_Common.pm')
-rw-r--r-- | FS/FS/svc_Common.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/FS/FS/svc_Common.pm b/FS/FS/svc_Common.pm index 35415a2..73658f6 100644 --- a/FS/FS/svc_Common.pm +++ b/FS/FS/svc_Common.pm @@ -1154,7 +1154,9 @@ Runs the provided export hook (i.e. "suspend", "unsuspend") for this service. sub export { my( $self, $method ) = ( shift, shift ); + # $method must start with export_, $action must be the part after that $method = "export_$method" unless $method =~ /^export_/; + my ($action) = $method =~ /^export_(\w+)/; local $SIG{HUP} = 'IGNORE'; local $SIG{INT} = 'IGNORE'; @@ -1171,6 +1173,7 @@ sub export { unless ( $noexport_hack ) { foreach my $part_export ( $self->cust_svc->part_svc->part_export ) { next unless $part_export->can($method); + next if $part_export->get("no_$action"); # currently only 'no_suspend' my $error = $part_export->$method($self, @_); if ( $error ) { $dbh->rollback if $oldAutoCommit; |