[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 05/16] PDU/MSW: Break out get()



This is going to be useful in a moment.

Signed-off-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>
---
 pdu-msw | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pdu-msw b/pdu-msw
index 04b03a22..58c33952 100755
--- a/pdu-msw
+++ b/pdu-msw
@@ -106,13 +106,18 @@ my @map= (undef, qw(
                     delayed-off
                     delayed-reboot));
 
-sub show () {
+sub get () {
     my $got= $session->get_request($read_oid);
     die "SNMP error reading $read_oid ".$session->error()." " unless $got;
     my $val= $got->{$read_oid};
     die unless $val;
     my $mean= $map[$val];
     die "$val ?" unless defined $mean;
+    return $mean;
+}
+
+sub show () {
+    my $mean = get();
     printf "pdu-msw $dnsname: #%s \"%s\" = %s\n", $useport, $usename, $mean;
 }
 
-- 
2.20.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.