[Rt-commit] rtir branch, 2.5-trunk, updated. 793c87eec0246819de3603310f7f9f7828695e5e

Ruslan Zakirov ruz at bestpractical.com
Wed Aug 19 14:17:22 EDT 2009


The branch, 2.5-trunk has been updated
       via  793c87eec0246819de3603310f7f9f7828695e5e (commit)
       via  dfefbe9f50c27b203123ac88870a67f3fa5bde24 (commit)
       via  e1131ba9ce930854b73b5f6f0ac3a998d62a522d (commit)
       via  e9e89c0e17f396ca25a5a54c50cc5142692464b4 (commit)
       via  f853b1b94cc531e7987fd311e363971a226b05dc (commit)
      from  b6a522443964261f1395aff60dd1f53e3de6d1a6 (commit)

Summary of changes:
 META.yml                                 |    2 +-
 lib/RT/Action/RTIR_FindIP.pm             |    2 +-
 lib/RT/Condition/RTIR_BlockActivation.pm |    4 ++--
 lib/RT/IR.pm                             |    8 +++++---
 4 files changed, 9 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit f853b1b94cc531e7987fd311e363971a226b05dc
Author: Ruslan Zakirov <ruz at bestpractica.com>
Date:   Thu Aug 13 19:35:33 2009 +0400

    bump new version, RTIR 2.5.1

diff --git a/META.yml b/META.yml
index 17fb1c9..b974696 100644
--- a/META.yml
+++ b/META.yml
@@ -33,4 +33,4 @@ requires:
   Regexp::Common: 0
   Regexp::Common::net::CIDR: 0
   perl: 5.8.3
-version: 2.5.0
+version: 2.5.1
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index e0e7393..24b1ed3 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -46,7 +46,7 @@
 #
 package RT::IR;
 
-our $VERSION = '2.5.0';
+our $VERSION = '2.5.1';
 
 use 5.008003;
 use warnings;

commit e9e89c0e17f396ca25a5a54c50cc5142692464b4
Author: Ruslan Zakirov <ruz at bestpractica.com>
Date:   Wed Aug 19 04:15:07 2009 +0400

    * logic around checking CF's type was incorrect

diff --git a/lib/RT/Action/RTIR_FindIP.pm b/lib/RT/Action/RTIR_FindIP.pm
index 9cd94cf..76d892a 100644
--- a/lib/RT/Action/RTIR_FindIP.pm
+++ b/lib/RT/Action/RTIR_FindIP.pm
@@ -40,7 +40,7 @@ sub Commit {
         $existing{ $_->Content } =  1;
     }
 
-    if ( $how_many_can && $how_many_can >= keys %existing ) {
+    if ( $how_many_can && $how_many_can <= keys %existing ) {
         $RT::Logger->debug("Ticket #". $ticket->id ." already has maximum number of IPs, skipping" );
         return 1;
     }

commit e1131ba9ce930854b73b5f6f0ac3a998d62a522d
Author: Ruslan Zakirov <ruz at bestpractica.com>
Date:   Wed Aug 19 22:13:52 2009 +0400

    adjust deserialization of IP from value with leading zeroes

diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 24b1ed3..aed9060 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -430,18 +430,20 @@ wrap 'RT::ObjectCustomFieldValue::Create',
 
 # strip zero chars(deserialize)
 {
+my $re_ip_sunit = qr/[0-1][0-9][0-9]|2[0-4][0-9]|25[0-5]/;
+my $re_ip_serialized = qr/$re_ip_sunit(?:\.$re_ip_sunit){3}/;
 my $obj;
 wrap 'RT::ObjectCustomFieldValue::Content',
     pre  => sub { $obj = $_[0] },
     post => sub {
         return unless $_[-1];
         my $val = ref $_[-1]? \$_[-1][0]: \$_[-1];
-        return unless $$val =~ /^\s*($RE{net}{IPv4})\s*$/;
+        return unless $$val =~ /^\s*($re_ip_serialized)\s*$/o;
         $$val = sprintf "%d.%d.%d.%d", split /\./, $1;
 
         my $large_content = $obj->__Value('LargeContent');
         return if !$large_content
-            || $large_content !~ /^\s*($RE{net}{IPv4})\s*$/;
+            || $large_content !~ /^\s*($re_ip_serialized)\s*$/o;
         my $eIP = sprintf "%d.%d.%d.%d", split /\./, $1;
         $$val .= '-'. $eIP unless $$val eq $eIP;
         return;

commit dfefbe9f50c27b203123ac88870a67f3fa5bde24
Author: Ruslan Zakirov <ruz at bestpractica.com>
Date:   Wed Aug 19 22:15:10 2009 +0400

    get rid of uninit warnings

diff --git a/lib/RT/Condition/RTIR_BlockActivation.pm b/lib/RT/Condition/RTIR_BlockActivation.pm
index 96a507d..a3269f0 100644
--- a/lib/RT/Condition/RTIR_BlockActivation.pm
+++ b/lib/RT/Condition/RTIR_BlockActivation.pm
@@ -30,8 +30,8 @@ sub IsApplicable {
         }
 
         return 0 unless $cf->id == $txn->Field;
-        return 0 unless ($txn->OldValue) eq 'pending activation';
-        return 0 unless ($txn->NewValue) eq 'active';
+        return 0 unless ($txn->OldValue||'') eq 'pending activation';
+        return 0 unless ($txn->NewValue||'') eq 'active';
         return 1;
     }
 

commit 793c87eec0246819de3603310f7f9f7828695e5e
Author: Ruslan Zakirov <ruz at bestpractica.com>
Date:   Wed Aug 19 22:15:52 2009 +0400

    * bump version

diff --git a/META.yml b/META.yml
index b974696..10acbe9 100644
--- a/META.yml
+++ b/META.yml
@@ -33,4 +33,4 @@ requires:
   Regexp::Common: 0
   Regexp::Common::net::CIDR: 0
   perl: 5.8.3
-version: 2.5.1
+version: 2.5.2
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index aed9060..c8b80ec 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -46,7 +46,7 @@
 #
 package RT::IR;
 
-our $VERSION = '2.5.1';
+our $VERSION = '2.5.2';
 
 use 5.008003;
 use warnings;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list