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-59-g4941486 (Apache)
2. [SCM] Netdot Git repository branch netdot-1.0 updated.
netdot-1.0.1-RC3-60-gc57c7e9 (Apache)
3. [SCM] Netdot Git repository branch netdot-1.0 updated.
netdot-1.0.1-RC3-62-gb08bff9 (Apache)
4. [SCM] Netdot Git repository branch netdot-1.0 updated.
netdot-1.0.1-RC3-63-g12494cd (Apache)
----------------------------------------------------------------------
Message: 1
Date: Thu, 26 Jul 2012 09:48:39 -0700
From: Apache <[email protected]>
Subject: [Netdot-devel] [SCM] Netdot Git repository branch netdot-1.0
updated. netdot-1.0.1-RC3-59-g4941486
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 49414860d8d5c24d6847a49647446b20d7131d5c (commit)
from 9e4e0cd7e8619a32811267fb893f58dba38c52b8 (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 49414860d8d5c24d6847a49647446b20d7131d5c
Author: Carlos Vicente <[email protected]>
Date: Thu Jul 26 12:47:59 2012 -0400
More deterministic sorting for sub-records in exported zone
diff --git a/lib/Netdot/Exporter/BIND.pm b/lib/Netdot/Exporter/BIND.pm
index 3f341f0..5e59ca4 100644
--- a/lib/Netdot/Exporter/BIND.pm
+++ b/lib/Netdot/Exporter/BIND.pm
@@ -166,7 +166,7 @@ sub print_zone_to_file {
print $fh $rr->as_text, "\n";
}
}else{
- foreach my $data ( keys %{$rec->{$name}->{$type}} ){
+ foreach my $data ( sort keys %{$rec->{$name}->{$type}} ){
if ( $argv{nopriv} && $type eq 'HINFO' ){
next;
}
-----------------------------------------------------------------------
Summary of changes:
lib/Netdot/Exporter/BIND.pm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
Netdot Git repository
------------------------------
Message: 2
Date: Thu, 26 Jul 2012 10:17:46 -0700
From: Apache <[email protected]>
Subject: [Netdot-devel] [SCM] Netdot Git repository branch netdot-1.0
updated. netdot-1.0.1-RC3-60-gc57c7e9
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 c57c7e9766c50fccd74e56a249a50fb8e9e1af26 (commit)
from 49414860d8d5c24d6847a49647446b20d7131d5c (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 c57c7e9766c50fccd74e56a249a50fb8e9e1af26
Author: Carlos Vicente <[email protected]>
Date: Thu Jul 26 13:17:07 2012 -0400
If a base MAC is not provided by BRIDGE-MIB, use the first available MAC
from interfaces. This helps creating a unique asset record for devices that do
not provide serial number or base MAC
diff --git a/lib/Netdot/Model/Device.pm b/lib/Netdot/Model/Device.pm
index 7ab9a1a..21bab57 100644
--- a/lib/Netdot/Model/Device.pm
+++ b/lib/Netdot/Model/Device.pm
@@ -5057,6 +5057,11 @@ sub _munge_speed_high {
##############################################################
# Assign Base MAC
#
+# Ideally this is the base MAC address from BRIDGE-MIB
+# but if that's not available, we'll assign the first good
+# MAC address from interfaces. This might be necessary
+# to create a unique asset
+#
# Arguments
# snmp info hashref
# Returns
@@ -5068,31 +5073,38 @@ sub _assign_base_mac {
my $host = $self->fqdn;
my $address = delete $info->{physaddr};
if ( $address && ($address = PhysAddr->validate($address)) ) {
- # Look it up
- my $mac;
- if ( $mac = PhysAddr->search(address=>$address)->first ){
- # The address exists
- # (may have been discovered in fw tables/arp cache)
- $mac->update({static=>1, last_seen=>$self->timestamp});
- $logger->debug(sub{"$host: Using existing $address as base bridge
address"});
- return $mac;
- }else{
- # address is new. Add it
- eval {
- $mac = PhysAddr->insert({address=>$address, static=>1});
- };
- if ( my $e = $@ ){
- $logger->debug(sprintf("%s: Could not insert base MAC: %s: %s",
- $host, $address, $e));
- }else{
- $logger->info(sprintf("%s: Inserted new base MAC: %s", $host,
$mac->address));
- return $mac;
+ # OK
+ }else{
+ $logger->warn(sub{"$host did not return base MAC. Using first available
interface MAC."});
+ foreach my $iid ( sort keys %{$info->{interface}} ){
+ if ( my $addr = $info->{interface}->{$iid}->{physaddr} ){
+ next unless ($address = PhysAddr->validate($addr));
+ last;
}
}
+ }
+ # Look it up
+ my $mac;
+ if ( $mac = PhysAddr->search(address=>$address)->first ){
+ # The address exists
+ # (may have been discovered in fw tables/arp cache)
+ $mac->update({static=>1, last_seen=>$self->timestamp});
+ $logger->debug(sub{"$host: Using existing $address as base bridge
address"});
+ return $mac;
}else{
- $logger->debug(sub{"$host did not return base MAC"});
- return;
+ # address is new. Add it
+ eval {
+ $mac = PhysAddr->insert({address=>$address, static=>1});
+ };
+ if ( my $e = $@ ){
+ $logger->debug(sprintf("%s: Could not insert base MAC: %s: %s",
+ $host, $address, $e));
+ }else{
+ $logger->info(sprintf("%s: Inserted new base MAC: %s", $host,
$mac->address));
+ return $mac;
+ }
}
+ $logger->debug("$host: No suitable base MAC found");
}
##############################################################
-----------------------------------------------------------------------
Summary of changes:
lib/Netdot/Model/Device.pm | 54 ++++++++++++++++++++++++++-----------------
1 files changed, 33 insertions(+), 21 deletions(-)
hooks/post-receive
--
Netdot Git repository
------------------------------
Message: 3
Date: Thu, 26 Jul 2012 10:59:40 -0700
From: Apache <[email protected]>
Subject: [Netdot-devel] [SCM] Netdot Git repository branch netdot-1.0
updated. netdot-1.0.1-RC3-62-gb08bff9
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 b08bff910f7cedd3b1a141bb33c4cf0dfec00d4d (commit)
via 51e6476808a772be91c427a05b461a9a8f9beede (commit)
from c57c7e9766c50fccd74e56a249a50fb8e9e1af26 (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 b08bff910f7cedd3b1a141bb33c4cf0dfec00d4d
Author: Carlos Vicente <[email protected]>
Date: Thu Jul 26 13:52:23 2012 -0400
Revert "Do not use <pre> tags to display comments in <textarea> boxes.
Instead, replace newlines with the HTML break tag"
This reverts commit 43ceacb4cfcc22b633c54480e8fa55e6abd6c2b3.
diff --git a/lib/Netdot/UI.pm b/lib/Netdot/UI.pm
index 98e067c..6f3da9d 100644
--- a/lib/Netdot/UI.pm
+++ b/lib/Netdot/UI.pm
@@ -1058,7 +1058,7 @@ sub text_area($@){
if ( $isEditing ){
$output .= sprintf("<textarea name=\"%s\" %s>%s</textarea>\n", $name,
$htmlExtra, $value);
}else{
- $output .= sprintf("%s", $self->nl2br($value));
+ $output .= sprintf("<pre>%s</pre>\n", $value);
}
if ($returnAsVar==1) {
@@ -2477,21 +2477,6 @@ sub check_value_lengths {
}
-############################################################################
-=head2 nl2br - Returns string with '<br />' inserted before all newlines.
-
- Arguments: string
- Returns: string
- Examples: $ui->nl2br($text);
-
-=cut
-sub nl2br {
- my ($self, $t) = @_;
- return unless $t;
- $t =~ s/([\r\n])/<br />$1/g;
- return $t;
-}
-
=head1 AUTHORS
Carlos Vicente, Nathan Collins, Aaron Parecki, Peter Boothe.
commit 51e6476808a772be91c427a05b461a9a8f9beede
Author: Carlos Vicente <[email protected]>
Date: Thu Jul 26 13:51:58 2012 -0400
Revert "Correctin"
This reverts commit 19be86294307870674b9a5c93ec981010e9816ba.
diff --git a/lib/Netdot/UI.pm b/lib/Netdot/UI.pm
index 6f43eaf..98e067c 100644
--- a/lib/Netdot/UI.pm
+++ b/lib/Netdot/UI.pm
@@ -2488,7 +2488,7 @@ sub check_value_lengths {
sub nl2br {
my ($self, $t) = @_;
return unless $t;
- $t =~ s/([\r\n])/<br \/>$1/g;
+ $t =~ s/([\r\n])/<br />$1/g;
return $t;
}
-----------------------------------------------------------------------
Summary of changes:
lib/Netdot/UI.pm | 17 +----------------
1 files changed, 1 insertions(+), 16 deletions(-)
hooks/post-receive
--
Netdot Git repository
------------------------------
Message: 4
Date: Thu, 26 Jul 2012 11:41:07 -0700
From: Apache <[email protected]>
Subject: [Netdot-devel] [SCM] Netdot Git repository branch netdot-1.0
updated. netdot-1.0.1-RC3-63-g12494cd
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 12494cd13bd12125ac2efd2294d0ed3542e7f4c4 (commit)
from b08bff910f7cedd3b1a141bb33c4cf0dfec00d4d (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 12494cd13bd12125ac2efd2294d0ed3542e7f4c4
Author: Carlos Vicente <[email protected]>
Date: Thu Jul 26 14:40:29 2012 -0400
Corrections
diff --git a/htdocs/management/ip.html b/htdocs/management/ip.html
index 25ab549..c5525aa 100644
--- a/htdocs/management/ip.html
+++ b/htdocs/management/ip.html
@@ -1637,7 +1637,7 @@ if ( $_action eq 'VIEW_ADD_RIGHTS' ){
<%perl>
} elsif ( $view_format eq 'list' ) {
my @children;
- if ( $o->status->name eq 'Subnet' ){
+ if ( $o->status->name eq 'Subnet' && $ip_list_sort ne "Device" ){
@children = $o->get_addresses_by($ip_list_sort);
}else{
@children = $o->children;
diff --git a/htdocs/management/ipblock_list.mhtml
b/htdocs/management/ipblock_list.mhtml
index fbf2d1c..1203a4e 100644
--- a/htdocs/management/ipblock_list.mhtml
+++ b/htdocs/management/ipblock_list.mhtml
@@ -56,14 +56,16 @@ if ( $type eq "address" ){
}
# @headers: header for html
push @headers, ( 'Address', 'Name', 'Device', 'Status', 'Used by',
'Description', 'Last Seen' );
+
+ # @text_headers: header for csv text
+ push @text_headers, ( 'Address', 'Name', 'Device', 'Status', 'Used by',
'Description', 'Last Seen' );
+
foreach my $header ( @headers ){
next if $header eq '[del]';
unless ( $sort eq $header ){
$header = "<a
href=\"ip.html?id=$parent&view_format=list&ip_list_sort=$header\">$header</a>";
}
}
- # @text_headers: header for csv text
- push @text_headers, ( 'Address', 'Name', 'Status', 'Used by',
'Description', 'Last Seen' );
foreach my $o ( @{ $objects } ) {
# @row: cell_data for html text
@@ -109,6 +111,10 @@ if ( $type eq "address" ){
push( @rows, \@row );
push( @$page, \@text_row);
}
+
+ # Special case: sort by device name
+ @rows = sort { $a->[2] cmp $b->[2] } @rows if ($sort eq 'Device');
+
} elsif( $type eq "block" ) {
$show_utilization = 0 if $edit;
-----------------------------------------------------------------------
Summary of changes:
htdocs/management/ip.html | 2 +-
htdocs/management/ipblock_list.mhtml | 10 ++++++++--
2 files changed, 9 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 27
********************************************