power jobs using device object instance instead of IP address

This commit is contained in:
Oliver Gorwits
2016-10-01 16:47:43 +01:00
parent 1f020e07ee
commit 4a81e7ca76
2 changed files with 10 additions and 4 deletions

View File

@@ -1,16 +1,20 @@
2.034000 2.034000
[NEW FEATURES]
* FreeBSD sshcollector support (H. Teulahti)
* Allow port name to be changed on pseudo devices
[ENHANCEMENTS] [ENHANCEMENTS]
* systemd deployment guide * systemd deployment guide
* document env var for https reverse proxy (B. Marshall) * 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) * [#279] Web sessions use cookies instead of files on disk (M. Johnson)
[BUG FIXES] [BUG FIXES]
* Improve security of REMOTE_USER handling (B. Marshall) * 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 2.033006 - 2016-03-20

View File

@@ -2,6 +2,7 @@ package App::Netdisco::Daemon::Worker::Interactive::PortActions;
use App::Netdisco::Util::Port ':all'; use App::Netdisco::Util::Port ':all';
use App::Netdisco::Util::SNMP 'snmp_connect_rw'; use App::Netdisco::Util::SNMP 'snmp_connect_rw';
use App::Netdisco::Util::Device 'get_device';
use App::Netdisco::Daemon::Util ':all'; use App::Netdisco::Daemon::Util ':all';
use Role::Tiny; use Role::Tiny;
@@ -63,7 +64,7 @@ sub _set_port_generic {
my ($job, $slot, $column) = @_; my ($job, $slot, $column) = @_;
$column ||= $slot; $column ||= $slot;
my $device = $job->device; my $device = get_device($job->device);
my $ip = $device->ip; my $ip = $device->ip;
my $pn = $job->port; my $pn = $job->port;
my $data = $job->subaction; my $data = $job->subaction;
@@ -116,7 +117,8 @@ sub power {
return job_error("Cannot alter port: $reconfig_check") return job_error("Cannot alter port: $reconfig_check")
if $reconfig_check; if $reconfig_check;
my $ip = $job->device; my $device = get_device($job->device);
my $ip = $device->ip;
my $pn = $job->port; my $pn = $job->port;
# munge data # munge data