topology import script runs discover for each device (M. Bauer)
This commit is contained in:
1
Changes
1
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]
|
||||
|
||||
|
||||
@@ -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<discover> job queued for them.
|
||||
|
||||
=cut
|
||||
|
||||
@@ -115,6 +118,11 @@ while (my $line = <DEVS>) {
|
||||
|
||||
$dev = get_device($ip->addr)->ip;
|
||||
print " Set device: $dev\n";
|
||||
|
||||
jq_insert({
|
||||
action => 'discover',
|
||||
device => $dev,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user