replace unicode nonbreaking space with ascii space (#794)

This commit is contained in:
nick n
2021-06-23 23:00:33 +02:00
committed by GitHub
parent ec1c0b5f39
commit 83a946d36e
49 changed files with 171 additions and 171 deletions

View File

@@ -19,9 +19,9 @@ register_worker({ phase => 'check' }, sub {
return Status->info("arpnip skipped: $device is not arpnipable")
unless is_arpnipable_now($device);
# support for Hooks
# support for Hooks
vars->{'hook_data'} = { $device->get_columns };
delete vars->{'hook_data'}->{'snmp_comm'}; # for privacy
delete vars->{'hook_data'}->{'snmp_comm'}; # for privacy
return Status->done('arpnip is able to run');
});

View File

@@ -34,7 +34,7 @@ sub gather_subnets {
my @subnets = ();
my $snmp = App::Netdisco::Transport::SNMP->reader_for($device)
or return (); # already checked!
or return (); # already checked!
my $ip_netmask = $snmp->ip_netmask;
foreach my $entry (keys %$ip_netmask) {

View File

@@ -16,7 +16,7 @@ register_worker({ phase => 'check' }, sub {
return Status->error("discover failed: no device param (need -d ?)")
if $device->ip eq '0.0.0.0';
# runner has already called get_device to promote $job->device
# runner has already called get_device to promote $job->device
return $job->cancel("fresh discover cancelled: $device already known")
if $device->in_storage
and ($job->subaction eq 'with-nodes' and not $job->username);

View File

@@ -43,7 +43,7 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
next unless ref {} eq ref $map;
foreach my $key (sort keys %$map) {
# lhs matches device, rhs matches device_ip
# lhs matches device, rhs matches device_ip
if (check_acl_only($device, $key)
and check_acl_only($alias, $map->{$key})) {
@@ -64,7 +64,7 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
}
}
}
} # ALIAS
} # ALIAS
}
return if $new_ip eq $old_ip;

View File

@@ -104,7 +104,7 @@ sub store_neighbors {
my @to_discover = ();
my $snmp = App::Netdisco::Transport::SNMP->reader_for($device)
or return (); # already checked!
or return (); # already checked!
# first allow any manually configured topology to be set
# and do this before we cache the rows in vars->{'device_ports'}
@@ -127,14 +127,14 @@ sub store_neighbors {
{ map {($_->port => $_)} $device->ports->reset->all };
my $device_ports = vars->{'device_ports'};
# v4 and v6 neighbor tables
# v4 and v6 neighbor tables
my $c_ip = ($snmp->c_ip || {});
my %c_ipv6 = %{ ($snmp->can('hasLLDP') and $snmp->hasLLDP)
? ($snmp->lldp_ipv6 || {}) : {} };
# remove keys with undef values, as c_ip does
# remove keys with undef values, as c_ip does
delete @c_ipv6{ grep { not defined $c_ipv6{$_} } keys %c_ipv6 };
# now combine them, v6 wins
# now combine them, v6 wins
$c_ip = { %$c_ip, %c_ipv6 };
foreach my $entry (sort (List::MoreUtils::uniq( keys %$c_ip ))) {

View File

@@ -71,11 +71,11 @@ register_worker({ phase => 'early', driver => 'snmp' }, sub {
}
}
# support for Hooks
# support for Hooks
vars->{'hook_data'} = { $device->get_columns };
delete vars->{'hook_data'}->{'snmp_comm'}; # for privacy
delete vars->{'hook_data'}->{'snmp_comm'}; # for privacy
# support for new_device Hook
# support for new_device Hook
vars->{'new_device'} = 1 if not $device->in_storage;
schema('netdisco')->txn_do(sub {
@@ -156,7 +156,7 @@ register_worker({ phase => 'early', driver => 'snmp' }, sub {
push @$resolved_aliases, { alias => $device->ip, dns => $device->dns }
if 0 == scalar grep {$_->{alias} eq $device->ip} @aliases;
# support for Hooks
# support for Hooks
vars->{'hook_data'}->{'device_ips'} = $resolved_aliases;
schema('netdisco')->txn_do(sub {
@@ -308,7 +308,7 @@ register_worker({ phase => 'early', driver => 'snmp' }, sub {
$interfaces{$master}->{is_master} = 'true';
}
# support for Hooks
# support for Hooks
vars->{'hook_data'}->{'ports'} = [values %interfaces];
schema('netdisco')->resultset('DevicePort')->txn_do_locked(sub {

View File

@@ -124,7 +124,7 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
};
}
# support for Hooks
# support for Hooks
vars->{'hook_data'}->{'vlans'} = \@devicevlans;
schema('netdisco')->txn_do(sub {

View File

@@ -12,7 +12,7 @@ register_worker({ phase => 'main' }, sub {
my $device = $job->device;
# if requested, and the device has not yet been
# arpniped/macsucked, queue those jobs now
# arpniped/macsucked, queue those jobs now
return unless $device->in_storage and $job->subaction eq 'with-nodes';
if (!defined $device->last_macsuck and $device->has_layer(2)) {

View File

@@ -56,7 +56,7 @@ register_worker({ phase => 'main' }, sub {
});
}
# also have to clean up node_ip that have no correspoding node
# also have to clean up node_ip that have no correspoding node
schema('netdisco')->resultset('NodeIp')->search({
mac => { -in => schema('netdisco')->resultset('NodeIp')->search(
{ port => undef },
@@ -82,7 +82,7 @@ register_worker({ phase => 'main' }, sub {
});
}
# now update stats
# now update stats
update_stats();
return Status->done('Checked expiry and updated stats');

View File

@@ -19,9 +19,9 @@ register_worker({ phase => 'check' }, sub {
return Status->info("macsuck skipped: $device is not macsuckable")
unless is_macsuckable_now($device);
# support for Hooks
# support for Hooks
vars->{'hook_data'} = { $device->get_columns };
delete vars->{'hook_data'}->{'snmp_comm'}; # for privacy
delete vars->{'hook_data'}->{'snmp_comm'}; # for privacy
return Status->done('Macsuck is able to run.');
});

View File

@@ -153,7 +153,7 @@ sub get_vlan_list {
my $device = shift;
my $snmp = App::Netdisco::Transport::SNMP->reader_for($device)
or return (); # already checked!
or return (); # already checked!
return () unless $snmp->cisco_comm_indexing;
@@ -270,7 +270,7 @@ sub walk_fwtable {
my $cache = {};
my $snmp = App::Netdisco::Transport::SNMP->reader_for($device)
or return $cache; # already checked!
or return $cache; # already checked!
my $fw_mac = $snmp->fw_mac || {};
my $fw_port = $snmp->fw_port || {};

View File

@@ -156,8 +156,8 @@ C<rancid>. All keys are optional:
rancid:
rancid_cvsroot: '$ENV{NETDISCO_HOME}/rancid' # default
rancid_conf: '/etc/rancid' # default
down_age: '1 day' # default
delimiter: ';' # default
down_age: '1 day' # default
delimiter: ';' # default
default_group: 'default' # default
groups:
groupname1: 'host_group1_acl'