From ac97d92ef124ddcc95b08b46fe00bfd075a64808 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 11 Mar 2014 21:49:39 +0000 Subject: [PATCH] Rename housekeeping expiry task to be expire --- Netdisco/Changes | 1 + Netdisco/lib/App/Netdisco.pm | 4 ++++ Netdisco/lib/App/Netdisco/Daemon/Queue.pm | 2 +- .../lib/App/Netdisco/Daemon/Worker/Manager.pm | 2 +- .../Netdisco/Daemon/Worker/Poller/Expiry.pm | 2 +- .../App/Netdisco/Daemon/Worker/Scheduler.pm | 2 +- .../lib/App/Netdisco/Manual/Configuration.pod | 2 +- .../lib/App/Netdisco/Manual/ReleaseNotes.pod | 6 +++++- Netdisco/share/config.yml | 18 +++++++++--------- Netdisco/share/environments/deployment.yml | 2 +- 10 files changed, 25 insertions(+), 16 deletions(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index fd37bdc4..3dba9f21 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -11,6 +11,7 @@ * Use daterange for IP Subnets (same as IP Inventory) * Run daemons as target binary's owning user (supports run control) * Clean up library path fiddling across all scripts + * Rename housekeeping expiry task to be expire [BUG FIXES] diff --git a/Netdisco/lib/App/Netdisco.pm b/Netdisco/lib/App/Netdisco.pm index ea875fd0..8f8a4079 100644 --- a/Netdisco/lib/App/Netdisco.pm +++ b/Netdisco/lib/App/Netdisco.pm @@ -50,6 +50,10 @@ setting('plugins')->{DBIC}->{daemon} = { setting('dns')->{no} ||= ['fe80::/64','169.254.0.0/16']; setting('dns')->{hosts_file} ||= '/etc/hosts'; +# housekeeping expire used to be called expiry +setting('housekeeping')->{expire} ||= setting('housekeeping')->{expiry} + if exists setting('housekeeping')->{expiry}; + =head1 NAME App::Netdisco - An open source web-based network management tool. diff --git a/Netdisco/lib/App/Netdisco/Daemon/Queue.pm b/Netdisco/lib/App/Netdisco/Daemon/Queue.pm index 71e8f563..b64d2915 100644 --- a/Netdisco/lib/App/Netdisco/Daemon/Queue.pm +++ b/Netdisco/lib/App/Netdisco/Daemon/Queue.pm @@ -23,7 +23,7 @@ sub capacity_for { my $action_map = { Poller => [ - qw/discoverall discover arpwalk arpnip macwalk macsuck nbtstat nbtwalk expiry/ + qw/discoverall discover arpwalk arpnip macwalk macsuck nbtstat nbtwalk expire/ ], Interactive => [qw/location contact portcontrol portname vlan power/], }; diff --git a/Netdisco/lib/App/Netdisco/Daemon/Worker/Manager.pm b/Netdisco/lib/App/Netdisco/Daemon/Worker/Manager.pm index 2834f6ad..134f94f1 100644 --- a/Netdisco/lib/App/Netdisco/Daemon/Worker/Manager.pm +++ b/Netdisco/lib/App/Netdisco/Daemon/Worker/Manager.pm @@ -13,7 +13,7 @@ my $fqdn = hostfqdn || 'localhost'; my $role_map = { (map {$_ => 'Poller'} - qw/discoverall discover arpwalk arpnip macwalk macsuck nbtstat nbtwalk expiry/), + qw/discoverall discover arpwalk arpnip macwalk macsuck nbtstat nbtwalk expire/), (map {$_ => 'Interactive'} qw/location contact portcontrol portname vlan power/) }; diff --git a/Netdisco/lib/App/Netdisco/Daemon/Worker/Poller/Expiry.pm b/Netdisco/lib/App/Netdisco/Daemon/Worker/Poller/Expiry.pm index 86156716..2741907d 100644 --- a/Netdisco/lib/App/Netdisco/Daemon/Worker/Poller/Expiry.pm +++ b/Netdisco/lib/App/Netdisco/Daemon/Worker/Poller/Expiry.pm @@ -9,7 +9,7 @@ use Role::Tiny; use namespace::clean; # expire devices and nodes according to config -sub expiry { +sub expire { my ($self, $job) = @_; if (setting('expire_devices') and setting('expire_devices') > 0) { diff --git a/Netdisco/lib/App/Netdisco/Daemon/Worker/Scheduler.pm b/Netdisco/lib/App/Netdisco/Daemon/Worker/Scheduler.pm index 27250a7b..f6f24f2d 100644 --- a/Netdisco/lib/App/Netdisco/Daemon/Worker/Scheduler.pm +++ b/Netdisco/lib/App/Netdisco/Daemon/Worker/Scheduler.pm @@ -15,7 +15,7 @@ my $jobactions = { arpwalk macwalk nbtwalk - expiry + expire / # saveconfigs # backup diff --git a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod index 1d6ef89d..f8599c7e 100644 --- a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod +++ b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod @@ -898,7 +898,7 @@ hour fields (which accept same types as C notation). For example: wday: 'mon-fri' nbtwalk: when: '0 8,13,21 * * *' - expiry: + expire: when: '20 23 * * *' Note that the "C" fields default to "all" (i.e. "C<*>") when not diff --git a/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod b/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod index 8dfcbfa8..399e5aae 100644 --- a/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod +++ b/Netdisco/lib/App/Netdisco/Manual/ReleaseNotes.pod @@ -48,6 +48,10 @@ The Web and Backend daemons will also now drop privilege to the same user and group as their files on disk. This allows you to symlink the programs as run-control scripts, yet maintain non-root privilege status. +The housekeeping task C has been renamed to C. Old +configuration will continue to work, but we recommend you rename this part of +your C configuration anyway. + =head1 2.023000 =head2 Incompatible Changes @@ -93,7 +97,7 @@ Add the following to your "C" configuration in C, to have a nightly check at 11:20pm: housekeeping: - expiry: + expire: when: '20 23 * * *' You should also configure one or more of C, C, diff --git a/Netdisco/share/config.yml b/Netdisco/share/config.yml index 5b5c287a..5fffcfee 100644 --- a/Netdisco/share/config.yml +++ b/Netdisco/share/config.yml @@ -175,17 +175,17 @@ dns: #housekeeping: # discoverall: -# when: '0 9 * * *' -# arpwalk: -# when: -# min: 30 +# when: '5 7 * * *' # macwalk: # when: -# min: 15 -# hour: '*/2' -# wday: 'mon-fri' -# nbtwalk: -# when: '0 8,13,21 * * *' +# min: 20 +# arpwalk: +# when: +# min: 50 +# nbtwalk: +# when: '0 8,13,21 * * *' +# expire: +# when: '20 23 * * *' # --------------- # DANCER INTERNAL diff --git a/Netdisco/share/environments/deployment.yml b/Netdisco/share/environments/deployment.yml index b332c731..86cddbdf 100644 --- a/Netdisco/share/environments/deployment.yml +++ b/Netdisco/share/environments/deployment.yml @@ -51,7 +51,7 @@ safe_password_store: true # min: 50 # nbtwalk: # when: '0 8,13,21 * * *' -# expiry: +# expire: # when: '20 23 * * *' # increase the performance of parallel DNS resolution for node