change device delete to use -p param for archive (preserve)

This commit is contained in:
Oliver Gorwits
2015-02-06 10:00:11 +00:00
parent 5b8a69be69
commit 8cb35f338b

View File

@@ -150,11 +150,8 @@ unless ($action) {
return ('error', "Don't know device: $device"); return ('error', "Don't know device: $device");
} }
$extra ||= ''; my $archive = 0; $port = ($port ? 1 : 0);
if ($extra =~ m/^(\d),(.+)/) { delete_device($dev->ip, $port, $extra);
($archive, $extra) = ($1, $2);
}
delete_device($dev->ip, $archive, $extra);
return ('done', "Deleted device $device."); return ('done', "Deleted device $device.");
} }
@@ -283,11 +280,11 @@ Run an arpnip on the device (specified with C<-d>).
Delete a device (specified with C<-d>). Pass a log message for the action in Delete a device (specified with C<-d>). Pass a log message for the action in
the C<-e> parameter. Optionally request for associated nodes to be archived the C<-e> parameter. Optionally request for associated nodes to be archived
(rather than deleted) by prefixing the C<-e> parameter with "C<1,>". (rather than deleted) by setting the C<-p> parameter to "C<yes>".
~netdisco/bin/netdisco-do delete -d 192.0.2.1 ~netdisco/bin/netdisco-do delete -d 192.0.2.1
~netdisco/bin/netdisco-do delete -d 192.0.2.1 -e 'older than the sun' ~netdisco/bin/netdisco-do delete -d 192.0.2.1 -e 'older than the sun'
~netdisco/bin/netdisco-do delete -d 192.0.2.1 -e '1,older than the sun' ~netdisco/bin/netdisco-do delete -d 192.0.2.1 -e 'older than the sun' -p yes
=head2 renumber =head2 renumber