#565 fix netdisco-do when no device param needed
This commit is contained in:
@@ -98,7 +98,7 @@ print color 'reset';
|
|||||||
|
|
||||||
my $term = Term::ReadLine->new('netdisco');
|
my $term = Term::ReadLine->new('netdisco');
|
||||||
my $bool = $term->ask_yn(
|
my $bool = $term->ask_yn(
|
||||||
prompt => 'So, is all off the above in place?', default => 'n',
|
prompt => 'So, is all of the above in place?', default => 'n',
|
||||||
);
|
);
|
||||||
|
|
||||||
exit(0) unless $bool;
|
exit(0) unless $bool;
|
||||||
|
|||||||
@@ -119,6 +119,9 @@ if (scalar @hostlist > 512) {
|
|||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# some actions do not take a device parameter
|
||||||
|
@hostlist = (undef) if 0 == scalar @hostlist;
|
||||||
|
|
||||||
foreach my $host (@hostlist) {
|
foreach my $host (@hostlist) {
|
||||||
my $dev = $host ? get_device($host->addr) : undef;
|
my $dev = $host ? get_device($host->addr) : undef;
|
||||||
if ($dev and not (blessed $dev and $dev->in_storage) and $action !~ m/^discover/) {
|
if ($dev and not (blessed $dev and $dev->in_storage) and $action !~ m/^discover/) {
|
||||||
@@ -205,11 +208,12 @@ pass C<action::stage> as the first argument to C<netdisco-do>, for example
|
|||||||
C<discover::neighbors>.
|
C<discover::neighbors>.
|
||||||
|
|
||||||
Any action taking a C<device> parameter can be passed either a hostname or IP
|
Any action taking a C<device> parameter can be passed either a hostname or IP
|
||||||
address of any interface of a known or unknown device, or an IP prefix (subnet)
|
address of any interface of a known or unknown device, or an IP prefix
|
||||||
which will cause C<netdisco-do> to run the action on all addresses in that range.
|
(subnet) which will cause C<netdisco-do> to run the action on all addresses in
|
||||||
|
that range.
|
||||||
|
|
||||||
The C<device> parameter may be passed multiple times. In this case, the devices
|
The C<device> parameter may be passed multiple times. In this case, all
|
||||||
will be handled one by one.
|
addresses (after expanding IP Prefixes) will be handled one by one.
|
||||||
|
|
||||||
=head2 discover
|
=head2 discover
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user