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.4-67-g3ece826 ([email protected])
   2. [SCM] Netdot branch master updated.       netdot-1.0.4-67-g3ece826
      ([email protected])
   3. [Netdot - Bug #1722] (Resolved) Illegal division by       zero with
      /31 IPv4 subnets ([email protected])
   4. [Netdot - Bug #1729] (Resolved) unable to import  NAPTR from
      bind format data ([email protected])
   5. [Netdot - Bug #1738] (Resolved) REST host resource        does not
      return propper HTTP status codes ([email protected])
   6. [SCM] Netdot branch netdot-1.0 updated.
      netdot-1.0.4-68-gefe8fce ([email protected])
   7. [SCM] Netdot branch netdot-1.0 updated.
      netdot-1.0.4-69-gd0151b4 ([email protected])
   8. [SCM] Netdot branch master updated.       netdot-1.0.4-69-gd0151b4
      ([email protected])


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

Message: 1
Date: Thu, 16 May 2013 12:41:44 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch netdot-1.0 updated.
        netdot-1.0.4-67-g3ece826
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  3ece8268c9671263496af491774389379c4b45d9 (commit)
       via  6f9811d1dae8b260cc8d679931f23d1cc9bae6bd (commit)
       via  5556277af175f3f8a8018f7c10630819707f9cf5 (commit)
      from  92f5160f12dfcaec085cf506e47e476cf81a4e13 (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 3ece8268c9671263496af491774389379c4b45d9
Author: Anton Berezin <[email protected]>
Date:   Mon May 13 22:00:26 2013 +0200

    Require NetAddr::IP 4.042 or more recent.
    
    This fixes issue 1722.

diff --git a/bin/perldeps.pl b/bin/perldeps.pl
index ab66aae..87f90cd 100755
--- a/bin/perldeps.pl
+++ b/bin/perldeps.pl
@@ -42,7 +42,7 @@ my @DEPS = (
     {cpan=>'SQL::Translator', apt=>'libsql-translator-perl', 
rpm=>'perl-SQL-Translator'},
     {cpan=>'SNMP::Info 2.06', apt=>'libsnmp-info-perl', rpm=>'perl-SNMP-Info'},
     {apt=>'netdisco-mibs-installer'},
-    {cpan=>'NetAddr::IP', apt=>'libnetaddr-ip-perl', rpm=>'perl-NetAddr-IP'},
+    {cpan=>'NetAddr::IP 4.042', apt=>'libnetaddr-ip-perl', 
rpm=>'perl-NetAddr-IP'},
     {cpan=>'Apache2::AuthCookie', apt=>'libapache2-authcookie-perl', rpm=>''},
     {cpan=>'Apache2::SiteControl', apt=>'libapache2-sitecontrol-perl', 
rpm=>''},
     {cpan=>'Log::Dispatch', apt=>'liblog-dispatch-perl', 
rpm=>'perl-Log-Dispatch'},

commit 6f9811d1dae8b260cc8d679931f23d1cc9bae6bd
Author: Anton Berezin <[email protected]>
Date:   Mon May 13 22:15:30 2013 +0200

    Strip \r's when importing a zone.
    
    This fixes issue 1729.

diff --git a/lib/Netdot/Model/Zone.pm b/lib/Netdot/Model/Zone.pm
index 685b8ef..1141038 100644
--- a/lib/Netdot/Model/Zone.pm
+++ b/lib/Netdot/Model/Zone.pm
@@ -650,7 +650,9 @@ sub import_records {
 
     if ( $argv{text } ){
        eval {
-           $rrs = Net::DNS::ZoneFile::Fast::parse(text=>$argv{text}, 
origin=>$domain);
+           my $zone_content = $argv{text};
+           $zone_content =~ s/\r\n/\n/g;
+           $rrs = Net::DNS::ZoneFile::Fast::parse(text=>$zone_content, 
origin=>$domain);
        };
        if ( my $e = $@ ){
            $self->throw_user("Error parsing Zone data: $e")

commit 5556277af175f3f8a8018f7c10630819707f9cf5
Author: Anton Berezin <[email protected]>
Date:   Wed May 15 21:42:24 2013 +0200

    Catch all REST exceptions.
    
    This fixes issue 1738.

diff --git a/htdocs/rest/autohandler b/htdocs/rest/autohandler
index fd56292..2c82232 100644
--- a/htdocs/rest/autohandler
+++ b/htdocs/rest/autohandler
@@ -19,6 +19,16 @@ if ( $DEBUG ){
     print "user: ", $user, "<br>";
     print "manager: ", $manager, "<br>";
 }
-$m->call_next(user=>$user, manager=>$manager);
+
+eval {
+    $m->call_next(user=>$user, manager=>$manager);
+};
+
+my $e;
+if ( $e = Netdot::Util::Exception->caught('Netdot::Util::Exception::REST') ){
+    $m->clear_and_abort($e->code);
+}elsif ( $e = $@ ){
+    die $e;
+}
 
 </%init>

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

Summary of changes:
 bin/perldeps.pl          |    2 +-
 htdocs/rest/autohandler  |   12 +++++++++++-
 lib/Netdot/Model/Zone.pm |    4 +++-
 3 files changed, 15 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Netdot


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

Message: 2
Date: Thu, 16 May 2013 12:42:34 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch master updated.
        netdot-1.0.4-67-g3ece826
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, master has been updated
       via  3ece8268c9671263496af491774389379c4b45d9 (commit)
       via  6f9811d1dae8b260cc8d679931f23d1cc9bae6bd (commit)
       via  5556277af175f3f8a8018f7c10630819707f9cf5 (commit)
      from  92f5160f12dfcaec085cf506e47e476cf81a4e13 (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 -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 bin/perldeps.pl          |    2 +-
 htdocs/rest/autohandler  |   12 +++++++++++-
 lib/Netdot/Model/Zone.pm |    4 +++-
 3 files changed, 15 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Netdot


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

Message: 3
Date: Thu, 16 May 2013 12:45:51 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1722] (Resolved) Illegal
        division by     zero with /31 IPv4 subnets
To: [email protected], [email protected], [email protected]
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1722 has been updated by Carlos Vicente.

Category set to IPManagement
Status changed from New to Resolved
Assignee set to Anton Berezin
Target version set to 1.0.5
Resolution set to fixed


----------------------------------------
Bug #1722: Illegal division by zero with /31 IPv4 subnets
https://osl.uoregon.edu/redmine/issues/1722#change-3076

Author: Matej Vadnjal
Status: Resolved
Priority: Normal
Assignee: Anton Berezin
Category: IPManagement
Target version: 1.0.5
Resolution: fixed


If I try to define a /31 IPv4 prefix of type Subnet in Management -> Address 
Space I get the following error:

@
error:  Illegal division by zero at 
/usr/local/netdot/htdocs/management/subnet.mhtml line 161.
context:        
...     
157:     $cols = 16;
158:    }
159:    
160:    my $num = ($mask == 31)? $net->num() : $net->num()+1;
161:    for( my $i=0; $i<($num/$cols); $i++ ) {
162:     my @row = ();
163:    
164:     for( my $j=0; $j<$cols; $j++ ) {
165:     my $ip_addr = $net->addr;
...     
code stack:      /usr/local/netdot/htdocs/management/subnet.mhtml:161
/usr/local/netdot/htdocs/management/ip.html:1732
/usr/local/netdot/htdocs/management/autohandler:81
/usr/share/perl5/HTML/Mason/Request.pm:936
/usr/local/netdot/htdocs/masondata/obj/991023240/management/autohandler.obj:21
/usr/local/netdot/htdocs/autohandler:76
@

The subnet is created in the database, but cannot be displayed. The exact same 
error appears if I select a /31 subnet already defined in netdot.

/31 Subnets discovered by SNMP on routers are added to netdot fine. But again 
cannot be "clicked on".

/31 Containers and Reserved work fine.

This is in version 1.0.4. I have a feeling this problem was not present in 
1.0.1, but I'm not a 100% sure.



-- 
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


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

Message: 4
Date: Thu, 16 May 2013 12:46:58 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1729] (Resolved) unable to
        import  NAPTR from bind format data
To: [email protected], [email protected],
        [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1729 has been updated by Carlos Vicente.

Status changed from In Progress to Resolved
Resolution set to fixed


----------------------------------------
Bug #1729: unable to import NAPTR from bind format data
https://osl.uoregon.edu/redmine/issues/1729#change-3077

Author: Karl Putland
Status: Resolved
Priority: Normal
Assignee: Anton Berezin
Category: DNS
Target version: 1.0.5
Resolution: fixed


Trying to import these

srv.myvtel.com. IN NAPTR 10 0 "s" "SIP+D2U" "" _sip._udp.myvtel.com.
srv.myvtel.com. IN NAPTR 20 0 "s" "SIP+D2T" "" _sip._tcp.myvtel.com.


results in 

Transaction aborted: Error parsing Zone data: bad NAPTR data, line 4

Stack:
  [/usr/local/share/perl/5.14.2/Net/DNS/ZoneFile/Fast.pm:240]
  [/usr/local/share/perl/5.14.2/Net/DNS/ZoneFile/Fast.pm:1003]
  [/usr/local/share/perl/5.14.2/Net/DNS/ZoneFile/Fast.pm:157]
  [/usr/local/netdot/lib/Netdot/Model/Zone.pm:653]
  [/usr/local/netdot/htdocs/management/zone.html:46]
  [/usr/local/netdot/htdocs/management/zone.html:47]
  [/usr/local/netdot/htdocs/management/autohandler:81]
  [/usr/local/share/perl/5.14.2/HTML/Mason/Request.pm:951]
  
[/usr/local/netdot/htdocs/masondata/obj/1292882063/management/autohandler.obj:21]
  [/usr/local/netdot/htdocs/autohandler:76]



-- 
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


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

Message: 5
Date: Thu, 16 May 2013 12:47:46 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1738] (Resolved) REST host
        resource        does not return propper HTTP status codes
To: [email protected], [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1738 has been updated by Carlos Vicente.

Category set to RestAPI
Status changed from In Progress to Resolved
Assignee set to Anton Berezin
Target version set to 1.0.5
Resolution set to fixed


----------------------------------------
Bug #1738: REST host resource does not return propper HTTP status codes
https://osl.uoregon.edu/redmine/issues/1738#change-3078

Author: Matej Vadnjal
Status: Resolved
Priority: Normal
Assignee: Anton Berezin
Category: RestAPI
Target version: 1.0.5
Resolution: fixed


If I do a request for something that does not exist, the response gets a HTTP 
status code OK. This is with Wireshark sees:

<pre>
GET /netdot/rest/host?rrid=5690 HTTP/1.1
Host: <removed>.arnes.si
Connection: keep-alive
Accept: text/xml; version=1.0
Cookie: Apache2::SiteControl_Netdot=<removed>;

HTTP/1.1 200 OK
Date: Tue, 19 Feb 2013 09:19:37 GMT
Server: Apache/2.2.15 (CentOS)
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

c
RR not found
0
</pre>

Status code 200 is returned no mater what kind of exception is thrown in 
@netdot/htdocs/rest/host@. The generic REST resources like Device and Ipblock 
return proper status code.

Looking at the code I think you should be catching exceptions thrown in 
@netdot/htdocs/rest/host@ and then calling @$m->clear_and_abort();@ like you do 
@netdot/htdocs/rest/dhandler@.



-- 
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


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

Message: 6
Date: Thu, 16 May 2013 13:13:38 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch netdot-1.0 updated.
        netdot-1.0.4-68-gefe8fce
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  efe8fce63dcef86499ebc40061c2513d9988bfed (commit)
      from  3ece8268c9671263496af491774389379c4b45d9 (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 efe8fce63dcef86499ebc40061c2513d9988bfed
Author: Carlos Vicente <[email protected]>
Date:   Thu May 16 16:13:23 2013 -0400

    Feature #1753 (Add DNS lookup to search)

diff --git a/htdocs/management/device_tasks.html 
b/htdocs/management/device_tasks.html
index 2a56cdf..03bc76b 100644
--- a/htdocs/management/device_tasks.html
+++ b/htdocs/management/device_tasks.html
@@ -64,23 +64,34 @@ if ( $submit eq 'Find' ){
            my $id = $o->id;
            $m->comp('/management/device.html', id => $id, user=>$user );
        }else{
-           $m->comp('/management/address_tasks.html', submit=>1, 
search_address=>$device_search, user=>$user, dowindow=>1 );
+           $m->comp('/management/address_tasks.html', submit=>1, 
search_address=>$device_search, 
+                    user=>$user, dowindow=>1 );
        }
     }else{
        $m->comp('.show_tasks', %ARGS, user=>$user);
        my %args = (name=>$device_search);
        $args{zone} = $zone_id if $zone_id;
-       unless ( (@list = Device->search_like(%args)) ){
-           $m->comp('/generic/no_search_results.html', search=>$device_search);
-       }
-       if ( scalar(@list) == 1 ){
-           # Don't offer list.  Just display device
-           my $o  = $list[0];
-           my $id = $o->id;
-           $m->comp('/management/device.html', id => $id, user=>$user );
+       if ( (@list = Device->search_like(%args)) ){
+           if ( scalar(@list) == 1 ){
+               # Don't offer list.  Just display device
+               my $o  = $list[0];
+               my $id = $o->id;
+               $m->comp('/management/device.html', id => $id, user=>$user );
+           }else{
+               $m->comp('/generic/show_search_results.mhtml', 
search=>$device_search, list=>\@list, 
+                        dowindow=>1 );
+           }
        }else{
-           $m->comp('/generic/show_search_results.mhtml', 
search=>$device_search, list=>\@list, dowindow=>1 );
+           # Lookup name in DNS
+           if ( my @ips = Netdot->dns->resolve_name($device_search) ){
+               # Just take the first one
+               $m->comp('/management/address_tasks.html', submit=>1, 
search_address=>$ips[0], 
+                        user=>$user, dowindow=>1 );
+           }else{
+               $m->comp('/generic/no_search_results.html', 
search=>$device_search);
+           }
        }
+
     }
 }else{
     $m->comp('.show_tasks', %ARGS, user=>$user);

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

Summary of changes:
 htdocs/management/device_tasks.html |   31 +++++++++++++++++++++----------
 1 files changed, 21 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
Netdot


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

Message: 7
Date: Fri, 17 May 2013 11:06:38 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch netdot-1.0 updated.
        netdot-1.0.4-69-gd0151b4
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  d0151b4eaebdccab0089aae142b3f7f0d81f2949 (commit)
      from  efe8fce63dcef86499ebc40061c2513d9988bfed (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 d0151b4eaebdccab0089aae142b3f7f0d81f2949
Author: Carlos Vicente <[email protected]>
Date:   Fri May 17 14:05:52 2013 -0400

    Correction

diff --git a/lib/Netdot/Exporter/Nagios.pm b/lib/Netdot/Exporter/Nagios.pm
index 5303744..411bf7a 100644
--- a/lib/Netdot/Exporter/Nagios.pm
+++ b/lib/Netdot/Exporter/Nagios.pm
@@ -627,7 +627,6 @@ sub print_service {
                print $out "define serviceescalation{\n";
                print $out "\thost_name                $hostname\n";
                print $out "\tservice_description      $srvname\n";
-               print $out "\tdisplay_name             $displayname\n";
                print $out "\tfirst_notification       $fn\n";
                print $out "\tlast_notification        $ln\n";
                print $out "\tnotification_interval    
".$self->{NAGIOS_NOTIF_INTERVAL}."\n";

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

Summary of changes:
 lib/Netdot/Exporter/Nagios.pm |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Netdot


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

Message: 8
Date: Fri, 17 May 2013 11:07:10 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch master updated.
        netdot-1.0.4-69-gd0151b4
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, master has been updated
       via  d0151b4eaebdccab0089aae142b3f7f0d81f2949 (commit)
       via  efe8fce63dcef86499ebc40061c2513d9988bfed (commit)
      from  3ece8268c9671263496af491774389379c4b45d9 (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 -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 htdocs/management/device_tasks.html |   31 +++++++++++++++++++++----------
 lib/Netdot/Exporter/Nagios.pm       |    1 -
 2 files changed, 21 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
Netdot


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

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


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

Reply via email to