summaryrefslogtreecommitdiff
path: root/FS/FS/svc_dsl.pm
diff options
context:
space:
mode:
Diffstat (limited to 'FS/FS/svc_dsl.pm')
-rw-r--r--FS/FS/svc_dsl.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/FS/FS/svc_dsl.pm b/FS/FS/svc_dsl.pm
index 93d3570..c5557ec 100644
--- a/FS/FS/svc_dsl.pm
+++ b/FS/FS/svc_dsl.pm
@@ -263,6 +263,27 @@ sub check {
$self->SUPER::check;
}
+sub predelete_hook_first {
+ my $self = shift;
+ my @exports = $self->part_svc->part_export_dsl_pull;
+ return 'More than one DSL-pulling export attached' if scalar(@exports) > 1;
+ if ( scalar(@exports) == 1 ) {
+ my $export = $exports[0];
+ return $export->dsl_pull($self);
+ }
+ '';
+}
+
+sub predelete_hook {
+ my $self = shift;
+ my @notes = $self->notes;
+ foreach my $note ( @notes ) {
+ my $error = $note->delete;
+ return $error if $error;
+ }
+ '';
+}
+
=back
=head1 SEE ALSO