From 4a81e7ca76aae7b6d89abacf16b48f72ae373511 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 1 Oct 2016 16:47:43 +0100 Subject: [PATCH] power jobs using device object instance instead of IP address --- Netdisco/Changes | 8 ++++++-- .../App/Netdisco/Daemon/Worker/Interactive/PortActions.pm | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index 7ea1d588..ee33591f 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -1,16 +1,20 @@ 2.034000 + [NEW FEATURES] + + * FreeBSD sshcollector support (H. Teulahti) + * Allow port name to be changed on pseudo devices + [ENHANCEMENTS] * systemd deployment guide * document env var for https reverse proxy (B. Marshall) - * FreeBSD sshcollector support (H. Teulahti) * [#279] Web sessions use cookies instead of files on disk (M. Johnson) [BUG FIXES] * Improve security of REMOTE_USER handling (B. Marshall) - * portcontrol jobs using device object instance instead of IP address + * portcontrol and power jobs using device instance instead of IP address 2.033006 - 2016-03-20 diff --git a/Netdisco/lib/App/Netdisco/Daemon/Worker/Interactive/PortActions.pm b/Netdisco/lib/App/Netdisco/Daemon/Worker/Interactive/PortActions.pm index a5362505..3ab5048c 100644 --- a/Netdisco/lib/App/Netdisco/Daemon/Worker/Interactive/PortActions.pm +++ b/Netdisco/lib/App/Netdisco/Daemon/Worker/Interactive/PortActions.pm @@ -2,6 +2,7 @@ package App::Netdisco::Daemon::Worker::Interactive::PortActions; use App::Netdisco::Util::Port ':all'; use App::Netdisco::Util::SNMP 'snmp_connect_rw'; +use App::Netdisco::Util::Device 'get_device'; use App::Netdisco::Daemon::Util ':all'; use Role::Tiny; @@ -63,7 +64,7 @@ sub _set_port_generic { my ($job, $slot, $column) = @_; $column ||= $slot; - my $device = $job->device; + my $device = get_device($job->device); my $ip = $device->ip; my $pn = $job->port; my $data = $job->subaction; @@ -116,7 +117,8 @@ sub power { return job_error("Cannot alter port: $reconfig_check") if $reconfig_check; - my $ip = $job->device; + my $device = get_device($job->device); + my $ip = $device->ip; my $pn = $job->port; # munge data