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-38-gfad9c81 ([email protected])
2. [Netdot - Bug #1732] (Resolved) Unable to create new objects
via REST ([email protected])
3. Re: [Netdot - Bug #1735] Table rrloc not Created
(Michael H Lambert)
4. Re: [Netdot - Feature #1734] CLI Support for Netscreen ISG
(ScreenOS) (Troi Johannes)
5. [Netdot - Bug #1737] (New) PTR record not properly updated
when changing Ipblock across reverse DNS zones
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Thu, 14 Feb 2013 12:46:39 -0800
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch netdot-1.0 updated.
netdot-1.0.4-38-gfad9c81
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 fad9c81abf551d5445973bc11ac0272b1b9d613f (commit)
via 825b74e83dbcc3259b6f2dbeb9beed30d5423306 (commit)
via 778e2b4dd2d2e3aa813867d7c1b1686b7fcac3dd (commit)
via 677cb0786a9f75cec67a3c4be8c076a9df5e9a72 (commit)
from 64daae1923f58f2145b90ff5272f5048c43de18d (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 fad9c81abf551d5445973bc11ac0272b1b9d613f
Author: Carlos Vicente <[email protected]>
Date: Thu Feb 14 15:46:21 2013 -0500
#1732 (Unable to create new objects via REST)
diff --git a/lib/Netdot/REST.pm b/lib/Netdot/REST.pm
index 0cb9c1c..e1bad37 100644
--- a/lib/Netdot/REST.pm
+++ b/lib/Netdot/REST.pm
@@ -215,7 +215,8 @@ sub handle_resource {
}
}
}else{
- $self->throw(code=>Apache2::Const::HTTP_BAD_REQUEST,
msg=>'Netdot::REST::handle_resource: Bad request');
+ $self->throw(code=>Apache2::Const::HTTP_BAD_REQUEST,
+ msg=>'Netdot::REST::handle_resource: Bad request');
}
}
@@ -340,19 +341,27 @@ sub post{
my ($self, %argv) = @_;
$self->isa_object_method('post');
- unless ( $argv{obj} || ($argv{table} && $argv{id}) ){
- $self->throw_fatal("Missing required arguments");
- }
-
- my $obj = $argv{obj} || $argv{table}->retrieve($argv{id});
- unless ( $obj ) {
- my $msg = sprintf("Netdot::REST::post: %s/%s not found", $argv{table},
$argv{id});
- $self->throw(code=>Apache2::Const::NOT_FOUND, msg=>$msg);
+ my ($obj, $table);
+ if ( $argv{obj} ){
+ $obj = $argv{obj}
+ }elsif ( $table = $argv{table} ){
+ if ( $argv{id} ){
+ $obj = $table->retrieve($argv{id});
+ unless ( $obj ) {
+ my $msg = sprintf("Netdot::REST::post: %s/%s not found",
$argv{table}, $argv{id});
+ $self->throw(code=>Apache2::Const::NOT_FOUND, msg=>$msg);
+ }
+ }
+ }else{
+ $self->throw(code=>Apache2::Const::HTTP_BAD_REQUEST,
+ msg=>'Netdot::REST::post: Problem with arguments.');
}
+
# These are not part of the data. Remove them.
foreach my $f ( qw/obj table id/ ){
delete $argv{$f};
}
+
if ( $obj ){
# We are updating an existing object
# Only admins can edit things this way
@@ -367,18 +376,18 @@ sub post{
};
if ( my $e = $@ ){
$self->throw(code=>Apache2::Const::HTTP_BAD_REQUEST,
- msg=>'Netdot::REST::post: Bad request: $e');
+ msg=>"Netdot::REST::post: Bad request: $e");
}
return $self->get(obj=>$obj);
}else{
# We are inserting a new object
my $obj;
eval {
- $obj = $argv{table}->insert(\%argv);
+ $obj = $table->insert(\%argv);
};
if ( my $e = $@ ){
$self->throw(code=>Apache2::Const::HTTP_BAD_REQUEST,
- msg=>'Netdot::REST::post: Bad request: $e');
+ msg=>"Netdot::REST::post: Bad request: $e");
}
return $self->get(obj=>$obj);
}
commit 825b74e83dbcc3259b6f2dbeb9beed30d5423306
Author: Carlos Vicente <[email protected]>
Date: Thu Feb 14 14:49:38 2013 -0500
Feature #1730 (Entity search should search on account number)
diff --git a/htdocs/contacts/entities.html b/htdocs/contacts/entities.html
index 8ca4dc3..944d2fb 100644
--- a/htdocs/contacts/entities.html
+++ b/htdocs/contacts/entities.html
@@ -175,6 +175,7 @@ if ( $_action eq "SEARCH" && $submit ){
my %idx;
map { $idx{$_->id} = $_ } Entity->search_like(name => $search);
map { $idx{$_->id} = $_ } Entity->search_like(short_name => $search);
+ map { $idx{$_->id} = $_ } Entity->search_like(acctnumber => $search);
# deeper search, within entitysite
my @sites = Site->search_like(name => $search);
foreach my $s ( @sites ) {
commit 778e2b4dd2d2e3aa813867d7c1b1686b7fcac3dd
Author: Carlos Vicente <[email protected]>
Date: Thu Feb 14 14:44:53 2013 -0500
Fix for #1726 (Deep recursion when I delete DNS record)
diff --git a/lib/Netdot/Model/RR.pm b/lib/Netdot/Model/RR.pm
index 16c878e..514fa12 100644
--- a/lib/Netdot/Model/RR.pm
+++ b/lib/Netdot/Model/RR.pm
@@ -368,7 +368,7 @@ sub delete {
my @cnames = RRCNAME->search(cname=>$self->get_label);
my @mxs = RRMX->search(exchange=>$self->get_label);
foreach my $o ( @cnames, @mxs ){
- $o->rr->delete();
+ $o->rr->delete() if ($o->rr->get_label ne $self->get_label);
}
return $self->SUPER::delete();
}
commit 677cb0786a9f75cec67a3c4be8c076a9df5e9a72
Author: Carlos Vicente <[email protected]>
Date: Thu Feb 14 14:15:44 2013 -0500
Fix for #1736 (REST updating host without passing name param doesn't work)
diff --git a/htdocs/rest/host b/htdocs/rest/host
index 4cb7d0b..225d834 100644
--- a/htdocs/rest/host
+++ b/htdocs/rest/host
@@ -175,7 +175,7 @@ if ( $rest->{request}->method eq 'GET' ){
my %args; # For update method
# These are the only records we allow changing
foreach my $rarg ( qw/name expiration info/ ){
- $args{$rarg} = $ARGS{$rarg};
+ $args{$rarg} = $ARGS{$rarg} if ( defined $ARGS{$rarg} );
}
# Hostname validation
-----------------------------------------------------------------------
Summary of changes:
htdocs/contacts/entities.html | 1 +
htdocs/rest/host | 2 +-
lib/Netdot/Model/RR.pm | 2 +-
lib/Netdot/REST.pm | 33 +++++++++++++++++++++------------
4 files changed, 24 insertions(+), 14 deletions(-)
hooks/post-receive
--
Netdot
------------------------------
Message: 2
Date: Thu, 14 Feb 2013 12:47:22 -0800
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1732] (Resolved) Unable to
create new objects via REST
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
Issue #1732 has been updated by Carlos Vicente.
Category set to Netdot
Status changed from New to Resolved
Assignee set to Carlos Vicente
Target version set to 1.0.5
Resolution set to fixed
There were several problems in that method. Thank you for the report!
cv
----------------------------------------
Bug #1732: Unable to create new objects via REST
https://osl.uoregon.edu/redmine/issues/1732#change-3044
Author: Matej Vadnjal
Status: Resolved
Priority: Normal
Assignee: Carlos Vicente
Category: Netdot
Target version: 1.0.5
Resolution: fixed
I'm using Netdot::Client::REST to create a new Ipblock:
<pre>
...
my $netdot = Netdot::Client::REST->new(
server => $location,
username => $user,
password => $pass,
);
my $r = $netdot->post("Ipblock", {
address => '10.1.1.1',
status => 'Static',
prefix => 32,
description => 'test'
});
</pre>
Calling post method results in this exception:
<pre>
File does not exist: Missing required arguments
Trace begun at /usr/local/netdot/lib/Netdot.pm line 105
Netdot::throw_fatal('Netdot::REST=HASH(0x7fe96bb09f30)', 'Missing required
arguments') called at /usr/local/netdot/lib/Netdot/REST.pm line 343
Netdot::REST::post('Netdot::REST=HASH(0x7fe96bb09f30)', 'table', 'Ipblock',
'status', 'Static', 'address', 10.1.1.1, 'description', 'test', 'prefix', 32)
called at /usr/local/netdot/lib/Netdot/REST.pm line 213
Netdot::REST::handle_resource('Netdot::REST=HASH(0x7fe96bb09f30)', 'resource',
'Ipblock', 'r', 'Apache2::Request=SCALAR(0x7fe968e6ae50)', 'status', 'Static',
'address', 10.1.1.1, 'description', 'test', 'prefix', 32) called at
/usr/local/netdot/htdocs/rest/dhandler line 35
eval {...} at /usr/local/netdot/htdocs/rest/dhandler line 34
...
</pre>
The problem is in sub post in netdot/lib/Netdot/REST.pm. The function expects
an id argument and searches for an object with this id
<pre>
unless ( $argv{obj} || ($argv{table} && $argv{id}) ){
$self->throw_fatal("Missing required arguments");
}
my $obj = $argv{obj} || $argv{table}->retrieve($argv{id});
unless ( $obj ) {
my $msg = sprintf("Netdot::REST::post: %s/%s not found", $argv{table},
$argv{id});
$self->throw(code=>Apache2::Const::NOT_FOUND, msg=>$msg);
}
</pre>
This makes it impossible to create new records via REST.
Tested with rev c6a4654561.
--
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: 3
Date: Thu, 14 Feb 2013 14:42:16 -0500
From: Michael H Lambert <[email protected]>
Subject: Re: [Netdot-devel] [Netdot - Bug #1735] Table rrloc not
Created
To: [email protected]
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
I'm running the Netdot 1.0.4 tarball. And p5-SQL-Translator-0.11016 (the
latest version in FreeBSD ports).
Michael
On 14 Feb 2013, at 14:35, [email protected] wrote:
>
> Issue #1735 has been updated by Carlos Vicente.
>
> Assignee set to Carlos Vicente
>
> This sounds like the problem in #1710. What version of Netdot and
> SQL::Translator are you using?
>
> I can confirm that the rrloc table does get created at install.
------------------------------
Message: 4
Date: Fri, 15 Feb 2013 09:35:38 +0000
From: Troi Johannes <[email protected]>
Subject: Re: [Netdot-devel] [Netdot - Feature #1734] CLI Support for
Netscreen ISG (ScreenOS)
To: "<[email protected]> <[email protected]>"
<[email protected]>
Cc: "<[email protected]>" <[email protected]>
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="Windows-1252"
I will try to write a the specific Netscreen ScreenOS class for CLI support.
Can you give me some advice, if it will be enough to add the
NetscreenScreenOS.pm to netdot/lib/Netdot/Model/Device/CLI or will be necessary
something else?
Regards,
Johannes
Am 14.02.2013 um 20:39 schrieb <[email protected]>
<[email protected]>:
>
> Issue #1734 has been updated by Carlos Vicente.
>
>
> Johannes,
>
> Thank you for the nice comments.
>
> I do not have Netscreens to work with, and honestly, no time. If you submit a
> patch, I would gladly add it to the project.
>
> Regards,
>
> cv
> ----------------------------------------
> Feature #1734: CLI Support for Netscreen ISG (ScreenOS)
> https://osl.uoregon.edu/redmine/issues/1734#change-3040
>
> Author: Johannes Troi
> Status: New
> Priority: Normal
> Assignee:
> Category:
> Target version:
> Resolution:
>
>
> Hello!
>
> We are running a Netscreen-ISG 2000 (ScreenOS 6.3), that principally supports
> ARP Fetching via SNMP. Unfortunately the SNMP Engine from the Netscreen
> firewall returns a wrong interface number (not existent interface "0") for
> all ARP entries on logical subinterfaces, so there is no match with the
> interface table und the ARP entries are ignored by netdot.
>
> Secondly the Netscreen doesn't report the IPv6 Neighbor Cache by SNMP. Would
> it be possible to add CLI support for feching ARP/Neighbor Cache from
> Netscreen-ISG?
>
> The output from "get arp" (IPv4 ARP Table) on ScreenOS (6.3) is:
> ISG-> get arp
> usage: 1219/8192 miss: 0
> always-on-dest: disabled
> -----------------------------------------------------------------------------------------
> IP Mac VR/Interface State Age Retry
> PakQue Sess_cnt
> -----------------------------------------------------------------------------------------
> 10.7.2.7 0018fe883b58 untrust-vr/agg1.2 VLD 52 0
> 0 16
>
>
> ... and for "get ndp" (IPv6 Neighbor Cache):
> ISG-> get ndp
> usage: 1/8192 miss: 0 always-on-dest: disabled
> states(S): N Undefined, X Deleted, I Incomplete, R Reachable, L Stale, D
> Delay,
> P Probe, F Probe forever S Static, A Active, I Inactive, * persistent
> --------------------------------------------------------------------------------
> IPv6 Address Link-Layer Addr S Interface Age
> Pk
> 2a02:27e8:0:aaaa:7:ffff:1:100 0008e3fffc1f R aggregate1.761
> 00h00m37s 0
>
> Thank you for developing netdot, we are very happy with this tool at the
> "Free University of Bozen/Bolzano"! :-)
> Johannes
>
>
> --
> 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
Johannes Troi
Information & Communication Technology
Free University of Bozen-Bolzano
Universit?tsplatz 1 ? Piazza Universit?, 1
I-39100 Bozen-Bolzano
Tel.: +39 0471 011854
Fax: +39 0471 011809
E-mail: [email protected]
www.unibz.it
------------------------------
Message: 5
Date: Fri, 15 Feb 2013 07:35:46 -0800
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1737] (New) PTR record not
properly updated when changing Ipblock across reverse DNS zones
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
Issue #1737 has been reported by Matej Vadnjal.
----------------------------------------
Bug #1737: PTR record not properly updated when changing Ipblock across reverse
DNS zones
https://osl.uoregon.edu/redmine/issues/1737
Author: Matej Vadnjal
Status: New
Priority: Normal
Assignee:
Category:
Target version:
Resolution:
When changing Ipblock address there is a block of code in Ipblock.pm/update sub
that updates PTR record associated with that address. It works fine if the old
and new address belong to the same DNS reverse zone.
However if the new address falls in a different reverse zone than the old one
the PTR record is not updated properly.
Example:
There are two subnets:
* 10.0.0.0/24 with associated reverse zone 0.0.10.in-addr.arpa
* 192.168.0.0/24 with reverse zone 0.168.192.in-addr.arpa
There is an Ipblock with address 10.0.0.5 and status Static. It has a PTR
record that looks like this:
<pre>
name: 5
zone: [reference to 0.0.10.in-addr.arpa]
ptrdname: test.example.com
</pre>
If you change the address of the Ipblock 10.0.0.5 to 192.168.0.2 the PTR record
will look like this:
<pre>
name: 2.0.168.192.in-addr.arpa
zone: [reference to 0.0.10.in-addr.arpa]
ptrdname: test.example.com
</pre>
You would expect it to look like this:
<pre>
name: 2
zone: reference to 0.168.192.in-addr.arpa
ptrdname: test.example.com
</pre>
I've attached a patch that fixes this, though it needs some review. Mainly what
to do if the new address has no associated reverse zone.
--
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 71, Issue 11
********************************************