Send Netdot-devel mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://osl.uoregon.edu/mailman/listinfo/netdot-devel
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Netdot-devel digest..."


Today's Topics:

   1. [SCM] Netdot branch netdot-1.0 updated.
      netdot-1.0.7-17-gb76eca0 ([email protected])
   2. [Netdot - Bug #1854] (In Progress) Addresses in   "Available"
      status not marked as "Discovered" if seen again   in ARP tables
      ([email protected])


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

Message: 1
Date: Mon, 18 May 2015 07:13:10 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch netdot-1.0 updated.
        netdot-1.0.7-17-gb76eca0
To: [email protected]
Message-ID: <[email protected]>

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Netdot".

The branch, netdot-1.0 has been updated
       via  b76eca08ae9fe76604a6e1f538806bc69f144f32 (commit)
       via  8963d657e1cf497a0b2427ac775d4c581df702e7 (commit)
       via  62d085adc0326010bdcb8bea34a77fb5d66dc8e2 (commit)
      from  6c067629f655bd998520c63d41067a1560499a91 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b76eca08ae9fe76604a6e1f538806bc69f144f32
Author: Carlos Vicente <[email protected]>
Date:   Mon May 18 10:12:14 2015 -0400

    Revert "Merge branch 'bug_1854' into netdot-1.0"
    
    This reverts commit 8963d657e1cf497a0b2427ac775d4c581df702e7, reversing
    changes made to 6c067629f655bd998520c63d41067a1560499a91.

diff --git a/lib/Netdot/Model/Ipblock.pm b/lib/Netdot/Model/Ipblock.pm
index cc174be..0bad1bc 100644
--- a/lib/Netdot/Model/Ipblock.pm
+++ b/lib/Netdot/Model/Ipblock.pm
@@ -1064,12 +1064,10 @@ sub fast_update{
 
     if ( $class->config->get('DB_TYPE') eq 'mysql' ){
        # Take advantage of MySQL's "ON DUPLICATE KEY UPDATE" 
-       my $sth = $dbh->prepare_cached(
-           "INSERT INTO ipblock 
(address,prefix,version,status,first_seen,last_seen)
-                                 VALUES (?, ?, ?, ?, ?, ?)
-             ON DUPLICATE KEY UPDATE last_seen=VALUES(last_seen),
-                                     status=VALUES(status);"
-           );
+       my $sth = $dbh->prepare_cached("INSERT INTO ipblock
+                                        
(address,prefix,version,status,first_seen,last_seen)
+                                        VALUES (?, ?, ?, ?, ?, ?)
+                                        ON DUPLICATE KEY UPDATE 
last_seen=VALUES(last_seen);");
 
        foreach my $address ( keys %$ips ){
            my $attrs = $ips->{$address};
@@ -1081,9 +1079,7 @@ sub fast_update{
     }else{
 
        # Build SQL queries
-       my $sth1 = $dbh->prepare_cached("UPDATE ipblock 
-                                            SET last_seen=?,status=? 
-                                          WHERE address=?");   
+       my $sth1 = $dbh->prepare_cached("UPDATE ipblock SET last_seen=? WHERE 
address=?");      
        
        my $sth2 = $dbh->prepare_cached("INSERT INTO ipblock 
                                           
(address,prefix,version,status,first_seen,last_seen)
@@ -1103,7 +1099,7 @@ sub fast_update{
            if ( my $e = $@ ){
                # Probably duplicate. Try to update.
                eval {
-                   $sth1->execute($attrs->{timestamp}, $dec_addr, 
$attrs->{status});
+                   $sth1->execute($attrs->{timestamp}, $dec_addr);
                };
                if ( my $e2 = $@ ){
                    $logger->error($e2);

commit 8963d657e1cf497a0b2427ac775d4c581df702e7
Merge: 6c06762 62d085a
Author: Carlos Vicente <[email protected]>
Date:   Fri May 8 08:53:41 2015 -0400

    Merge branch 'bug_1854' into netdot-1.0


commit 62d085adc0326010bdcb8bea34a77fb5d66dc8e2
Author: Carlos Vicente <[email protected]>
Date:   Fri May 1 15:57:23 2015 -0400

    Fix for #1854 (Addresses in 'Available' status not marked as 'Discovered' 
if seen again in ARP tables)

diff --git a/lib/Netdot/Model/Ipblock.pm b/lib/Netdot/Model/Ipblock.pm
index 0bad1bc..cc174be 100644
--- a/lib/Netdot/Model/Ipblock.pm
+++ b/lib/Netdot/Model/Ipblock.pm
@@ -1064,10 +1064,12 @@ sub fast_update{
 
     if ( $class->config->get('DB_TYPE') eq 'mysql' ){
        # Take advantage of MySQL's "ON DUPLICATE KEY UPDATE" 
-       my $sth = $dbh->prepare_cached("INSERT INTO ipblock
-                                        
(address,prefix,version,status,first_seen,last_seen)
-                                        VALUES (?, ?, ?, ?, ?, ?)
-                                        ON DUPLICATE KEY UPDATE 
last_seen=VALUES(last_seen);");
+       my $sth = $dbh->prepare_cached(
+           "INSERT INTO ipblock 
(address,prefix,version,status,first_seen,last_seen)
+                                 VALUES (?, ?, ?, ?, ?, ?)
+             ON DUPLICATE KEY UPDATE last_seen=VALUES(last_seen),
+                                     status=VALUES(status);"
+           );
 
        foreach my $address ( keys %$ips ){
            my $attrs = $ips->{$address};
@@ -1079,7 +1081,9 @@ sub fast_update{
     }else{
 
        # Build SQL queries
-       my $sth1 = $dbh->prepare_cached("UPDATE ipblock SET last_seen=? WHERE 
address=?");      
+       my $sth1 = $dbh->prepare_cached("UPDATE ipblock 
+                                            SET last_seen=?,status=? 
+                                          WHERE address=?");   
        
        my $sth2 = $dbh->prepare_cached("INSERT INTO ipblock 
                                           
(address,prefix,version,status,first_seen,last_seen)
@@ -1099,7 +1103,7 @@ sub fast_update{
            if ( my $e = $@ ){
                # Probably duplicate. Try to update.
                eval {
-                   $sth1->execute($attrs->{timestamp}, $dec_addr);
+                   $sth1->execute($attrs->{timestamp}, $dec_addr, 
$attrs->{status});
                };
                if ( my $e2 = $@ ){
                    $logger->error($e2);

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

Summary of changes:


hooks/post-receive
-- 
Netdot


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

Message: 2
Date: Mon, 18 May 2015 07:16:27 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1854] (In Progress) Addresses
        in      "Available" status not marked as "Discovered" if seen again     
in ARP
        tables
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1854 has been updated by Carlos Vicente.

Status changed from Resolved to In Progress
Resolution deleted (fixed)

Previous fix was incorrect because it set anything back to "Discovered". 

Need to think of a fast way to deal with "Available" addresses.
----------------------------------------
Bug #1854: Addresses in "Available" status not marked as "Discovered" if seen 
again in ARP tables
https://osl.uoregon.edu/redmine/issues/1854#change-3299

Author: Carlos Vicente
Status: In Progress
Priority: Normal
Assignee: Carlos Vicente
Category: DeviceManagement
Target version: 1.0.8
Resolution: 





-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


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

_______________________________________________
Netdot-devel mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-devel


End of Netdot-devel Digest, Vol 98, Issue 8
*******************************************

Reply via email to