From 5b8a69be69c7f2cfddfe4ac3d8e2057ff47c8a27 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Fri, 6 Feb 2015 09:59:37 +0000 Subject: [PATCH] fix power action to accept yes/no action --- .../App/Netdisco/Daemon/Worker/Interactive/PortActions.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Netdisco/lib/App/Netdisco/Daemon/Worker/Interactive/PortActions.pm b/Netdisco/lib/App/Netdisco/Daemon/Worker/Interactive/PortActions.pm index 23ca92e1..0fea9ea8 100644 --- a/Netdisco/lib/App/Netdisco/Daemon/Worker/Interactive/PortActions.pm +++ b/Netdisco/lib/App/Netdisco/Daemon/Worker/Interactive/PortActions.pm @@ -113,10 +113,13 @@ sub power { return job_error("Cannot alter port: $reconfig_check") if $reconfig_check; - my $ip = $job->device; my $pn = $job->port; + + # munge data (my $data = $job->subaction) =~ s/-\w+//; # remove -other + $data = 'true' if $data =~ m/^(on|yes|up)$/; + $data = 'false' if $data =~ m/^(off|no|down)$/; # snmp connect using rw community my $info = snmp_connect_rw($ip)