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 Git repository branch netdot-1.0 updated.
netdot-1.0.1-RC3-28-gc99b1b7 (Apache)
2. [Netdot - Bug #1662] Support for staging dir
([email protected])
3. [Netdot - Bug #1662] (Resolved) Support for staging dir
([email protected])
4. [SCM] Netdot Git repository branch netdot-1.0 updated.
netdot-1.0.1-RC3-29-g8e78f0e (Apache)
5. [SCM] Netdot Git repository branch netdot-1.0 updated.
netdot-1.0.1-RC3-30-g12cdebd (Apache)
----------------------------------------------------------------------
Message: 1
Date: Sun, 22 Jul 2012 18:19:03 -0700
From: Apache <[email protected]>
Subject: [Netdot-devel] [SCM] Netdot Git repository branch netdot-1.0
updated. netdot-1.0.1-RC3-28-gc99b1b7
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 Git repository".
The branch, netdot-1.0 has been updated
via c99b1b74d6abbd8cee378f5fef65d3ca9c1869ac (commit)
via cfb18434df24ec0bcad6eaa03d430a28354f85c4 (commit)
from 4d0746b7df150f137b6c2af26b199adf6c73bdaf (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 c99b1b74d6abbd8cee378f5fef65d3ca9c1869ac
Author: Carlos Vicente <[email protected]>
Date: Sun Jul 22 18:18:48 2012 -0700
In REST interface, make inclusion of linked_from objects optional and
default to no
diff --git a/htdocs/rest/dhandler b/htdocs/rest/dhandler
index 8a911f4..be5f4c5 100644
--- a/htdocs/rest/dhandler
+++ b/htdocs/rest/dhandler
@@ -29,6 +29,7 @@ if ( $DEBUG ){
# specific component for the given request
#
use Netdot::REST;
+delete $ARGS{manager};
my $rest = Netdot::REST->new(user=>$user, manager=>$manager);
eval {
$rest->handle_resource(resource=>$resource, r=>$r, %ARGS);
diff --git a/lib/Netdot/REST.pm b/lib/Netdot/REST.pm
index f2e10e9..b97efc9 100644
--- a/lib/Netdot/REST.pm
+++ b/lib/Netdot/REST.pm
@@ -148,9 +148,7 @@ sub handle_resource {
if ( $argv{depth} ){
$get_args{depth} = $argv{depth};
}
- if ( $argv{no_linked_from} ){
- $get_args{no_linked_from} = $argv{no_linked_from};
- }
+ $get_args{linked_from} = $argv{linked_from};
my $o = $self->get(%get_args);
$self->print_formatted($o);
@@ -179,12 +177,12 @@ sub handle_resource {
# A lack of id means we're working in plural
my $results;
my $depth;
- my $no_linked_from;
+ my $linked_from;
if ( %argv ){
# We were given a query hash
# Remove non-fields
$depth = delete $argv{depth};
- $no_linked_from = delete $argv{no_linked_from};
+ $linked_from = delete $argv{linked_from};
}
if ( %argv ){
# If there are any args left do a search with them
@@ -197,7 +195,7 @@ sub handle_resource {
while ( my $o = $results->next ){
my %get_args = (obj=>$o);
$get_args{depth} = $depth if ( $depth );
- $get_args{no_linked_from} = $no_linked_from if (
$no_linked_from );
+ $get_args{linked_from} = $linked_from if defined(
$linked_from );
push @objs, $self->get(%get_args);
}
$self->print_formatted({$table=>\@objs});
@@ -231,10 +229,11 @@ sub handle_resource {
snmp_target => "192.168.1.1"
snmp_target_xlink => "Ipblock/1"
- In the case of objects linking to the given record, the returned hashref
- will include a key called "linked_from" containing arrays of resources
+ In the case of objects referencing the given record, the returned hashref
+ can include a key called "linked_from" containing arrays of resources
which can be used to obtain those records using the REST interface.
- You can omit these resources by using the 'no_linked_from' parameter
+ You can get these resources by passing the 'linked_from' with a value of 1.
+ The default is to not include these records.
Arguments:
Hash containing the following keys:
@@ -243,7 +242,7 @@ sub handle_resource {
xlink xlink string (see above)
id The id of the object
depth How many levels of foreign objects to return (default:
0)
- no_linked_from Do not return foreign objects referencing this object
+ linked_from Return foreign objects referencing this object
Returns:
hashref containing object information
Examples:
@@ -280,7 +279,7 @@ sub get{
my %order = $obj->meta_data->get_column_order;
my %linksto = $obj->meta_data->get_links_to;
- unless($argv{no_linked_from}){
+ if( $argv{linked_from} ){
$ret{linked_from} = $self->_get_linked_from(obj=>$obj,
depth=>$argv{depth});
}
@@ -294,7 +293,7 @@ sub get{
table => $fclass,
id => $fid,
depth => $argv{depth}-1,
- no_linked_from => $argv{no_linked_from},
+ linked_from => $argv{linked_from},
);
}else{
my $fobj = $obj->$col;
@@ -570,6 +569,7 @@ sub _get_linked_from{
my %results;
foreach my $i ( keys %linksfrom ){
my $rtable = (keys %{$linksfrom{$i}})[0]; # Table that points to us
+ next if ( $rtable =~ /_history$/o ); # Do not include history records
my @robjs = $obj->$i; # Objects that point to us
if ( $depth ){
map { push @{$results{$i}}, $self->get(table=>$rtable, id=>$_->id,
depth=>$depth-1) } @robjs;
commit cfb18434df24ec0bcad6eaa03d430a28354f85c4
Author: Carlos Vicente <[email protected]>
Date: Sun Jul 22 17:51:04 2012 -0700
Correction
diff --git a/htdocs/generic/edit.html b/htdocs/generic/edit.html
index cd141ac..ae28680 100644
--- a/htdocs/generic/edit.html
+++ b/htdocs/generic/edit.html
@@ -140,7 +140,7 @@ if ( $table ){
if ( $state_digest && ($state_digest ne $new_digest) ){
$ui->throw_user('This object changed while you were
editing!');
}
- $ui->check_value_lenghts($table, \%args);
+ $ui->check_value_lengths($table, \%args);
$obj->update(\%args);
});
};
-----------------------------------------------------------------------
Summary of changes:
htdocs/generic/edit.html | 2 +-
htdocs/rest/dhandler | 1 +
lib/Netdot/REST.pm | 24 ++++++++++++------------
3 files changed, 14 insertions(+), 13 deletions(-)
hooks/post-receive
--
Netdot Git repository
------------------------------
Message: 2
Date: Mon, 23 Jul 2012 01:44:12 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1662] Support for staging dir
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
Issue #1662 has been updated by Francesco Colista.
I tryied the patch attached on the issue you mention, it works.
Thanks for your reply.
----------------------------------------
Bug #1662: Support for staging dir
https://osl.uoregon.edu/redmine/issues/1662
Author: Francesco Colista
Status: New
Priority: Normal
Assignee:
Category:
Target version:
Resolution:
Hi. I'm trying to compile netdot for Alpine Linux (www.alpinelinux.org).
Netdot actually does not support staging dir, so when the package is created
the substitution of PREFIX uses the full path.
This cause an extensive patching in order to remove the unneeded path.
Would be possible to include the possibility to install netdot in a temp dir,
in the upstream?
This is a patch for Makefile:
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<
--- ./Makefile.orig
+++ ./Makefile
@@ -91,14 +91,14 @@
@echo "Creating necessary directories..."
echo $(PREFIX) > ./.prefix
for dir in $(DIR); do \
- if test -d $(PREFIX)/$$dir; then \
- echo "Skipping dir $(PREFIX)/$$dir; already exists"; \
+ if test -d $(DESTDIR)$(PREFIX)/$$dir; then \
+ echo "Skipping dir $(DESTDIR)$(PREFIX)/$$dir; already exists"; \
else \
- mkdir -m $(DMOD) -p $(PREFIX)/$$dir ; \
+ mkdir -m $(DMOD) -p $(DESTDIR)$(PREFIX)/$$dir ; \
fi ; \
done
- chown -R $(APACHEUSER):$(APACHEGROUP) $(PREFIX)/tmp
- chmod 750 $(PREFIX)/tmp
+ chown -R $(APACHEUSER):$(APACHEGROUP) $(DESTDIR)$(PREFIX)/tmp
+ chmod 750 $(DESTDIR)$(PREFIX)/tmp
htdocs:
cd $@ ; $(MAKE) all DIR=$@
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<
Thanks.
--
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: Mon, 23 Jul 2012 06:31:36 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1662] (Resolved) Support for
staging dir
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
Issue #1662 has been updated by Carlos Vicente.
Status changed from New to Resolved
Resolution set to duplicate
----------------------------------------
Bug #1662: Support for staging dir
https://osl.uoregon.edu/redmine/issues/1662
Author: Francesco Colista
Status: Resolved
Priority: Normal
Assignee:
Category:
Target version:
Resolution: duplicate
Hi. I'm trying to compile netdot for Alpine Linux (www.alpinelinux.org).
Netdot actually does not support staging dir, so when the package is created
the substitution of PREFIX uses the full path.
This cause an extensive patching in order to remove the unneeded path.
Would be possible to include the possibility to install netdot in a temp dir,
in the upstream?
This is a patch for Makefile:
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<
--- ./Makefile.orig
+++ ./Makefile
@@ -91,14 +91,14 @@
@echo "Creating necessary directories..."
echo $(PREFIX) > ./.prefix
for dir in $(DIR); do \
- if test -d $(PREFIX)/$$dir; then \
- echo "Skipping dir $(PREFIX)/$$dir; already exists"; \
+ if test -d $(DESTDIR)$(PREFIX)/$$dir; then \
+ echo "Skipping dir $(DESTDIR)$(PREFIX)/$$dir; already exists"; \
else \
- mkdir -m $(DMOD) -p $(PREFIX)/$$dir ; \
+ mkdir -m $(DMOD) -p $(DESTDIR)$(PREFIX)/$$dir ; \
fi ; \
done
- chown -R $(APACHEUSER):$(APACHEGROUP) $(PREFIX)/tmp
- chmod 750 $(PREFIX)/tmp
+ chown -R $(APACHEUSER):$(APACHEGROUP) $(DESTDIR)$(PREFIX)/tmp
+ chmod 750 $(DESTDIR)$(PREFIX)/tmp
htdocs:
cd $@ ; $(MAKE) all DIR=$@
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<
Thanks.
--
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: Mon, 23 Jul 2012 06:55:34 -0700
From: Apache <[email protected]>
Subject: [Netdot-devel] [SCM] Netdot Git repository branch netdot-1.0
updated. netdot-1.0.1-RC3-29-g8e78f0e
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 Git repository".
The branch, netdot-1.0 has been updated
via 8e78f0e8038e44a2f08b28774d8b7ea5e53e6c65 (commit)
from c99b1b74d6abbd8cee378f5fef65d3ca9c1869ac (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 8e78f0e8038e44a2f08b28774d8b7ea5e53e6c65
Author: Carlos Vicente <[email protected]>
Date: Mon Jul 23 06:55:20 2012 -0700
Bug fix in REST throw exception method
diff --git a/lib/Netdot/REST.pm b/lib/Netdot/REST.pm
index b97efc9..d224fe3 100644
--- a/lib/Netdot/REST.pm
+++ b/lib/Netdot/REST.pm
@@ -537,7 +537,7 @@ sub check_accept_header{
=cut
sub throw {
my ($self, %args) = @_;
- return $self->SUPER::throw_rest(@_);
+ return $self->SUPER::throw_rest(%args);
}
##################################################################
-----------------------------------------------------------------------
Summary of changes:
lib/Netdot/REST.pm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
Netdot Git repository
------------------------------
Message: 5
Date: Mon, 23 Jul 2012 07:18:26 -0700
From: Apache <[email protected]>
Subject: [Netdot-devel] [SCM] Netdot Git repository branch netdot-1.0
updated. netdot-1.0.1-RC3-30-g12cdebd
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 Git repository".
The branch, netdot-1.0 has been updated
via 12cdebd260b5434e2075e468fd010824a06e32ec (commit)
from 8e78f0e8038e44a2f08b28774d8b7ea5e53e6c65 (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 12cdebd260b5434e2075e468fd010824a06e32ec
Author: Carlos Vicente <[email protected]>
Date: Mon Jul 23 10:17:54 2012 -0400
Corrected regex in topology discovery code
diff --git a/lib/Netdot/Topology.pm b/lib/Netdot/Topology.pm
index 1b7c1c9..f4a1502 100644
--- a/lib/Netdot/Topology.pm
+++ b/lib/Netdot/Topology.pm
@@ -516,9 +516,8 @@ sub get_dp_links {
unless ( $rem_int ){
# If interface name has a slot/sub-slot number
# (helps finding stuff like Gi2/7)
- my $ptrn;
- if ( $rem_port =~ /^([A-Z]{1})\S+?([\d\/\.])+$/io ){
- $ptrn = "'".$1.'%'.$2."'";
+ if ( $rem_port =~ /^([a-z]{2})[a-z]*([0-9\/.]+)$/io ){
+ my $ptrn = "'".$1.'%'.$2."'";
$rem_int = Interface->search_like(device=>$rem_dev,
name=>$ptrn)->first;
}
}
-----------------------------------------------------------------------
Summary of changes:
lib/Netdot/Topology.pm | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
hooks/post-receive
--
Netdot Git repository
------------------------------
_______________________________________________
Netdot-devel mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-devel
End of Netdot-devel Digest, Vol 64, Issue 21
********************************************