From 8e07636a1455a7802c76ed267d444966513266ba Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Wed, 17 May 2017 07:37:05 +0100 Subject: [PATCH] topology import script runs discover for each device (M. Bauer) --- Changes | 1 + bin/nd-import-topology | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 7fc219f3..704bea16 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,7 @@ [ENHANCEMENTTS] * renamed netdisco-daemon to netdisco-backend (and *-fg too) + * topology import script runs discover for each device (M. Bauer) [BUG FIXES] diff --git a/bin/nd-import-topology b/bin/nd-import-topology index e9a77081..54391cf5 100755 --- a/bin/nd-import-topology +++ b/bin/nd-import-topology @@ -37,7 +37,9 @@ use App::Netdisco; use Dancer ':script'; use Dancer::Plugin::DBIC 'schema'; +use App::Netdisco::JobQueue 'jq_insert'; use App::Netdisco::Util::Device 'get_device'; + use NetAddr::IP::Lite ':lower'; use Try::Tiny; @@ -63,7 +65,8 @@ The file syntax must be like so: link:left-port,right-device,right-port The devices can be either host names or IPs. Data will be imported even if the -devices are currently unknown to Netdisco. +devices are currently unknown to Netdisco. All imported devices will have a +C job queued for them. =cut @@ -115,6 +118,11 @@ while (my $line = ) { $dev = get_device($ip->addr)->ip; print " Set device: $dev\n"; + + jq_insert({ + action => 'discover', + device => $dev, + }); } }