From cf8589aba23cd33d3a364f99e8922860d57c5143 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sun, 21 May 2017 22:35:38 +0100 Subject: [PATCH] change from ignore to skip name --- lib/App/Netdisco/DB/Result/Admin.pm | 6 +++--- .../Netdisco/DB/Result/{DeviceIgnore.pm => DeviceSkip.pm} | 6 +++--- lib/App/Netdisco/JobQueue/PostgreSQL.pm | 4 ++-- share/schema_versions/App-Netdisco-DB-41-42-PostgreSQL.sql | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) rename lib/App/Netdisco/DB/Result/{DeviceIgnore.pm => DeviceSkip.pm} (83%) diff --git a/lib/App/Netdisco/DB/Result/Admin.pm b/lib/App/Netdisco/DB/Result/Admin.pm index 6378efaf..690a21a0 100644 --- a/lib/App/Netdisco/DB/Result/Admin.pm +++ b/lib/App/Netdisco/DB/Result/Admin.pm @@ -116,14 +116,14 @@ sub finished_stamp { return (shift)->get_column('finished_stamp') } =head1 RELATIONSHIPS -=head2 ignored +=head2 skipped -Retuns the set of C entries which may apply to this job. They +Retuns the set of C entries which may apply to this job. They match the device IP and job action, and may refer to one or more backends. =cut -__PACKAGE__->has_many( ignored => 'App::Netdisco::DB::Result::DeviceIgnore', +__PACKAGE__->has_many( skipped => 'App::Netdisco::DB::Result::DeviceSkip', { 'foreign.device' => 'self.device', 'foreign.action' => 'self.action' }, ); diff --git a/lib/App/Netdisco/DB/Result/DeviceIgnore.pm b/lib/App/Netdisco/DB/Result/DeviceSkip.pm similarity index 83% rename from lib/App/Netdisco/DB/Result/DeviceIgnore.pm rename to lib/App/Netdisco/DB/Result/DeviceSkip.pm index 23ddb430..f2b555f3 100644 --- a/lib/App/Netdisco/DB/Result/DeviceIgnore.pm +++ b/lib/App/Netdisco/DB/Result/DeviceSkip.pm @@ -1,11 +1,11 @@ use utf8; -package App::Netdisco::DB::Result::DeviceIgnore; +package App::Netdisco::DB::Result::DeviceSkip; use strict; use warnings; use base 'DBIx::Class::Core'; -__PACKAGE__->table("device_ignore"); +__PACKAGE__->table("device_skip"); __PACKAGE__->add_columns( "backend", { data_type => "text", is_nullable => 0 }, @@ -15,7 +15,7 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0 }, "failures", { data_type => "integer", is_nullable => 1, default_value => '0' }, - "ignore", + "skipover", { data_type => "boolean", is_nullable => 1, default_value => \'false' }, ); __PACKAGE__->set_primary_key("backend", "device", "action"); diff --git a/lib/App/Netdisco/JobQueue/PostgreSQL.pm b/lib/App/Netdisco/JobQueue/PostgreSQL.pm index 230067c2..d2026e6f 100644 --- a/lib/App/Netdisco/JobQueue/PostgreSQL.pm +++ b/lib/App/Netdisco/JobQueue/PostgreSQL.pm @@ -35,9 +35,9 @@ sub _getsome { my $rs = $jobs->search({ status => 'queued', - device => { '-not_in' => $jobs->correlate('ignored')->search({ + device => { '-not_in' => $jobs->correlate('skipped')->search({ backend => $fqdn, - -or => [{ failures => { '>=', 10 } },{ '-bool' => 'ignore' }], + -or => [{ failures => { '>=', 10 } },{ '-bool' => 'skipover' }], }, { columns => 'device' })->as_query }, %$where, }, { order_by => 'random()', rows => $num_slots }); diff --git a/share/schema_versions/App-Netdisco-DB-41-42-PostgreSQL.sql b/share/schema_versions/App-Netdisco-DB-41-42-PostgreSQL.sql index b7bee310..e4dfe2ee 100644 --- a/share/schema_versions/App-Netdisco-DB-41-42-PostgreSQL.sql +++ b/share/schema_versions/App-Netdisco-DB-41-42-PostgreSQL.sql @@ -1,11 +1,11 @@ BEGIN; -CREATE TABLE "device_ignore" ( +CREATE TABLE "device_skip" ( "backend" text NOT NULL, "device" inet NOT NULL, "action" text NOT NULL, "failures" integer DEFAULT 0, - "ignore" boolean DEFAULT false, + "skipover" boolean DEFAULT false, PRIMARY KEY ("backend", "device", "action") );