From 46236d68eae4b9bd8fcd47098782143051a62064 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sun, 1 Sep 2019 23:53:56 +0100 Subject: [PATCH] a fix up for pseudo devices which need layer 3 --- lib/App/Netdisco/JobQueue/PostgreSQL.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/App/Netdisco/JobQueue/PostgreSQL.pm b/lib/App/Netdisco/JobQueue/PostgreSQL.pm index e332131a9..c8faf5b83 100644 --- a/lib/App/Netdisco/JobQueue/PostgreSQL.pm +++ b/lib/App/Netdisco/JobQueue/PostgreSQL.pm @@ -79,6 +79,19 @@ sub jq_warm_thrusters { actionset => $actionset{$_}, }, { key => 'primary' }) for keys %actionset; }); + + # fix up the pseudo devices which need layer 3 + # TODO remove this after next release + schema('netdisco')->txn_do(sub { + my @hosts = grep { defined } + map { schema('netdisco')->resultset('Device')->search_for_device($_->{only}) } + grep { exists $_->{only} and ref '' eq ref $_->{only} } + grep { exists $_->{driver} and $_->{driver} eq 'cli' } + @{ setting('device_auth') }; + + $_->update({ layers => \[q{overlay(layers placing '1' from 6 for 1)}] }) + for @hosts; + }); } sub jq_getsome {