Skip Menu |

This queue is for tickets about the Nagios-Interface CPAN distribution.

Report information
The Basics
Id: 90668
Status: open
Priority: 0/
Queue: Nagios-Interface

People
Owner: Nobody in particular
Requestors: upasna.shukla [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: New Moose may break your code
Date: Sat, 23 Nov 2013 07:58:14 +0530
To: bug-Nagios-Interface [...] rt.cpan.org
From: "Upasana Shukla" <upasna.shukla [...] gmail.com>
We recently changed the syntax of enum declarations in Moose types. It appears that your module is affected. You can read more about the change here: https://metacpan.org/pod/release/ETHER/Moose-2.1106-TRIAL/lib/Moose/Manual/Delta.pod#pod2.1200 We recommend that you take a look at your code to see if it indeed does need to be updated with respect to the latest Moose release, 2.1106-TRIAL. If you have any questions, then please ask either on Moose mailing list : http://lists.perl.org/list/moose.html or on #moose & #moose-dev on irc.perl.org.
Attached patch fixes the enum warnings, but there're still some warnings from something else when I run the test. Check 'em out (attaching the output of prove -vlr t as well). -- Cheers, ZZ [ https://metacpan.org/author/ZOFFIX ]
Subject: Nagios-Interface-0.01.patch
diff -Naur Nagios-Interface-0.01_orig/lib/Nagios/Interface/Alert/Notification.pm Nagios-Interface-0.01/lib/Nagios/Interface/Alert/Notification.pm --- Nagios-Interface-0.01_orig/lib/Nagios/Interface/Alert/Notification.pm 2014-01-21 21:28:21.444540646 -0500 +++ Nagios-Interface-0.01/lib/Nagios/Interface/Alert/Notification.pm 2014-01-21 21:29:35.884541622 -0500 @@ -5,7 +5,7 @@ use Moose::Role; with 'Nagios::Interface::Alert'; -enum 'Nagios::NotifyMethod' => qw[email sms]; +enum 'Nagios::NotifyMethod' => [qw[email sms]]; coerce 'Nagios::NotifyMethod' => from 'Str' => via { s{.*notify-by-}{}; $_ }; diff -Naur Nagios-Interface-0.01_orig/lib/Nagios/Interface/Alert/Service.pm Nagios-Interface-0.01/lib/Nagios/Interface/Alert/Service.pm --- Nagios-Interface-0.01_orig/lib/Nagios/Interface/Alert/Service.pm 2014-01-21 21:28:21.444540646 -0500 +++ Nagios-Interface-0.01/lib/Nagios/Interface/Alert/Service.pm 2014-01-21 21:29:41.428541694 -0500 @@ -5,7 +5,7 @@ use Moose::Util::TypeConstraints; # 'FAIL' means Socket timeout -enum 'Nagios::ServiceState' => qw[OK WARNING CRITICAL FAIL UNKNOWN]; +enum 'Nagios::ServiceState' => [qw[OK WARNING CRITICAL FAIL UNKNOWN]]; has 'service' => isa => 'Str', diff -Naur Nagios-Interface-0.01_orig/t/test_control.cmd Nagios-Interface-0.01/t/test_control.cmd --- Nagios-Interface-0.01_orig/t/test_control.cmd 1969-12-31 19:00:00.000000000 -0500 +++ Nagios-Interface-0.01/t/test_control.cmd 2014-01-21 21:29:44.744541738 -0500 @@ -0,0 +1 @@ +[1390357784] SCHEDULE_SVC_DOWNTIME;frodo;Visibility;1390357784;1390358684;1;;;dummy;here's a comment
Subject: Nagios-Interface-0.01.test.warnings.txt
zoffix@ZofMain:~/Desktop/Downloads/DZIL/temp/Nagios-Interface-0.01$ prove -vlr t t/01-logparser.t ..... Attribute (interval) of class Nagios::Interface::LogRotation has no associated methods (did you mean to provide an "is" argument?) at /home/zoffix/perl5/lib/perl5/i686-linux-gnu-thread-multi-64int/Moose/Meta/Attribute.pm line 1003. Moose::Meta::Attribute::_check_associated_methods(Moose::Meta::Attribute=HASH(0x9a07394)) called at /home/zoffix/perl5/lib/perl5/i686-linux-gnu-thread-multi-64int/Moose/Meta/Class.pm line 580 Moose::Meta::Class::add_attribute(Moose::Meta::Class=HASH(0x98973e4), "interval", "definition_context", HASH(0x99fdc6c), "required", 1) called at /home/zoffix/perl5/lib/perl5/i686-linux-gnu-thread-multi-64int/Moose.pm line 77 Moose::has(Moose::Meta::Class=HASH(0x98973e4), "interval", "required", 1) called at /home/zoffix/perl5/lib/perl5/i686-linux-gnu-thread-multi-64int/Moose/Exporter.pm line 405 Moose::has("interval", "required", 1) called at /home/zoffix/Desktop/Downloads/DZIL/temp/Nagios-Interface-0.01/lib/Nagios/Interface/ConcreteTypes.pm line 530 require Nagios/Interface/ConcreteTypes.pm called at /home/zoffix/Desktop/Downloads/DZIL/temp/Nagios-Interface-0.01/lib/Nagios/Interface/Logfile.pm line 4 Nagios::Interface::Logfile::BEGIN() called at /home/zoffix/Desktop/Downloads/DZIL/temp/Nagios-Interface-0.01/lib/Nagios/Interface/ConcreteTypes.pm line 0 eval {...} called at /home/zoffix/Desktop/Downloads/DZIL/temp/Nagios-Interface-0.01/lib/Nagios/Interface/ConcreteTypes.pm line 0 require Nagios/Interface/Logfile.pm called at t/01-logparser.t line 10 main::BEGIN() called at /home/zoffix/Desktop/Downloads/DZIL/temp/Nagios-Interface-0.01/lib/Nagios/Interface/ConcreteTypes.pm line 0 eval {...} called at /home/zoffix/Desktop/Downloads/DZIL/temp/Nagios-Interface-0.01/lib/Nagios/Interface/ConcreteTypes.pm line 0 eval 'package main; #line 10 t/01-logparser.t use Nagios::Interface::Logfile @{$args[0]}; 1; ;' called at /home/zoffix/perl5/lib/perl5/Test/More.pm line 992 Test::More::_eval("package main;\x{a}\x{a}#line 10 t/01-logparser.t\x{a}use Nagios::Interfac"..., ARRAY(0x8f3d668)) called at /home/zoffix/perl5/lib/perl5/Test/More.pm line 967 Test::More::use_ok("Nagios::Interface::Logfile") called at t/01-logparser.t line 10 main::BEGIN() called at /home/zoffix/Desktop/Downloads/DZIL/temp/Nagios-Interface-0.01/lib/Nagios/Interface/ConcreteTypes.pm line 0 eval {...} called at /home/zoffix/Desktop/Downloads/DZIL/temp/Nagios-Interface-0.01/lib/Nagios/Interface/ConcreteTypes.pm line 0 ok 1 - use Nagios::Interface::Logfile; ok 2 - Nagios::Interface::Logfile->new ok 3 - Nagios::Interface::Logfile->can('parse_logline') ok 4 - 'parsed OK!' isa 'Nagios::Interface::ServiceNotification' ok 5 - Extracted time OK ok 6 - extracted notification method OK ok 7 - got message out ok 8 - ok ok 9 - host ok 10 - group ok 11 - 'parsed OK!' isa 'Nagios::Interface::ServiceAlert' ok 12 - converted SOFT to 1 ok 13 - Parsed a Nagios::Interface::LogRotation=HASH(0x9a48a60) OK ok 14 - Parsed a Nagios::Interface::LogVersion=HASH(0x9a4b698) OK ok 15 - Parsed a Nagios::Interface::CurrentHostState=HASH(0x9a55cf0) OK ok 16 - Parsed a Nagios::Interface::CurrentHostState=HASH(0x9a55d90) OK ok 17 - Parsed a Nagios::Interface::CurrentServiceState=HASH(0x9a55df4) OK ok 18 - Parsed a Nagios::Interface::ServiceAlert=HASH(0x9a56290) OK ok 19 - Parsed a Nagios::Interface::IgnorableLogMessage=HASH(0x9a55de0) OK ok 20 - Parsed a Nagios::Interface::HostAlert=HASH(0x9a562cc) OK ok 21 - Parsed a Nagios::Interface::HostFlappingAlert=HASH(0x9a5622c) OK ok 22 - Parsed all events successfully 1..22 ok t/02-statusparser.t .. ok 1 - use Nagios::Interface::Status; ok 2 - parsed file without dying ok 3 - got back 4 hoststatus blocks ok 4 - parsed hoststatus OK 1..4 ok t/03-control.t ....... ok 1 - use Nagios::Interface::Control; Attribute (interval) of class Nagios::Interface::LogRotation has no associated methods (did you mean to provide an "is" argument?) at /home/zoffix/perl5/lib/perl5/i686-linux-gnu-thread-multi-64int/Moose/Meta/Attribute.pm line 1003. Moose::Meta::Attribute::_check_associated_methods(Moose::Meta::Attribute=HASH(0x9fb164c)) called at /home/zoffix/perl5/lib/perl5/i686-linux-gnu-thread-multi-64int/Moose/Meta/Class.pm line 580 Moose::Meta::Class::add_attribute(Moose::Meta::Class=HASH(0x9e44c38), "interval", "definition_context", HASH(0x9fa9bfc), "required", 1) called at /home/zoffix/perl5/lib/perl5/i686-linux-gnu-thread-multi-64int/Moose.pm line 77 Moose::has(Moose::Meta::Class=HASH(0x9e44c38), "interval", "required", 1) called at /home/zoffix/perl5/lib/perl5/i686-linux-gnu-thread-multi-64int/Moose/Exporter.pm line 405 Moose::has("interval", "required", 1) called at /home/zoffix/Desktop/Downloads/DZIL/temp/Nagios-Interface-0.01/lib/Nagios/Interface/ConcreteTypes.pm line 530 require Nagios/Interface/ConcreteTypes.pm called at t/03-control.t line 12 main::BEGIN() called at /home/zoffix/Desktop/Downloads/DZIL/temp/Nagios-Interface-0.01/lib/Nagios/Interface/ConcreteTypes.pm line 0 eval {...} called at /home/zoffix/Desktop/Downloads/DZIL/temp/Nagios-Interface-0.01/lib/Nagios/Interface/ConcreteTypes.pm line 0 ok 2 - Got an entry time back ok 3 - Wrote a command to the nagios control file 1..3 ok All tests successful. Files=3, Tests=29, 1 wallclock secs ( 0.03 usr 0.00 sys + 1.20 cusr 0.04 csys = 1.27 CPU) Result: PASS