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. Re: [Netdot - Bug #1679] module inserted in transceiver port
container is not bound to asset (Erik Wenzel)
2. Re: [Netdot - Bug #1679] module inserted in transceiver port
container is not bound to asset (Carlos Vicente)
3. Re: keywords search case sensitivity (Karl Putland)
4. Re: [Netdot - Bug #1679] module inserted in transceiver port
container is not bound to asset (Erik Wenzel)
5. Re: [Netdot - Bug #1679] module inserted in transceiver port
container is not bound to asset (Carlos Vicente)
6. [SCM] UNNAMED PROJECT branch netdot-1.0 updated.
netdot-1.0.1-16-g599ddac ([email protected])
7. Re: keywords search case sensitivity (Carlos Vicente)
----------------------------------------------------------------------
Message: 1
Date: Wed, 29 Aug 2012 21:01:16 +0200
From: Erik Wenzel <[email protected]>
Subject: Re: [Netdot-devel] [Netdot - Bug #1679] module inserted in
transceiver port container is not bound to asset
To: [email protected]
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
Hey Carlos,
Am 29.08.2012 um 20:32 schrieb [email protected]:
> I have just looked at the code again and can confirm that it does look for
> serial numbers in existing assets. I have just tested with a 6509 by setting
> the asset field in the module to NULL (the asset is still in the DB, but not
> associated with any module). After rediscovering, the association is made
> again.
>
> The only thing that could be going on is that the asset's product is not from
> the same manufacturer as the device, because it searches for a combination of
> serial number and manufacturer.
I can confirm that the module is from a different manufaturer.
>
> I would need more details from you to try to figure out your problem.
What else can I test?
--
Erik
------------------------------
Message: 2
Date: Wed, 29 Aug 2012 15:13:32 -0400
From: Carlos Vicente <[email protected]>
Subject: Re: [Netdot-devel] [Netdot - Bug #1679] module inserted in
transceiver port container is not bound to asset
To: Erik Wenzel <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
On 8/29/12 3:01 PM, Erik Wenzel wrote:
> Hey Carlos,
>
> Am 29.08.2012 um 20:32 schrieb [email protected]:
>
>> I have just looked at the code again and can confirm that it does look for
>> serial numbers in existing assets. I have just tested with a 6509 by setting
>> the asset field in the module to NULL (the asset is still in the DB, but not
>> associated with any module). After rediscovering, the association is made
>> again.
>>
>> The only thing that could be going on is that the asset's product is not
>> from the same manufacturer as the device, because it searches for a
>> combination of serial number and manufacturer.
> I can confirm that the module is from a different manufaturer.
>
Well, that's the reason then.
That poses an interesting challenge. If we only look for an asset with
the given serial number, how to make sure that we are assigning the
right asset? There is the possibility that two manufacturers could use
the same serial numbers for their different products.
hmmm...
--
cv
------------------------------
Message: 3
Date: Wed, 29 Aug 2012 13:48:27 -0600
From: Karl Putland <[email protected]>
Subject: Re: [Netdot-devel] keywords search case sensitivity
To: [email protected]
Message-ID:
<ca+exwsxbwlek75rmfaxdwgaffdj_4wtfrrx_ezxnuxaz3u+...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Make search_like case insensitive.
This improves usability for me and my users.
diff -u Netdot.orig/Model.pm Netdot/Model.pm
--- Netdot.orig/Model.pm 2012-08-29 19:31:39.323838352 +0000
+++ Netdot/Model.pm 2012-08-29 19:45:08.559831642 +0000
@@ -531,10 +531,10 @@
} else {
# Fix lack of typecast introduced in Pg 8.x
if (Netdot->config->get('DB_TYPE') eq "Pg") {
- push @qual, "CAST($column AS text) LIKE ?";
+ push @qual, "UPPER(CAST($column AS text)) LIKE
UPPER(?)";
push @bind, $value;
} else {
- push @qual, "$column LIKE ?";
+ push @qual, "UPPER($column) LIKE UPPER(?)";
push @bind, $value;
}
}
--Karl
Karl Putland
Senior VoIP Engineer
*SimpleSignal*
3600 S Yosemite, Suite 150
Denver, CO 80237
One Number Rings All My Phones: 303-242-8608
SimpleSignal.com <http://www.simplesignal.com/> |
Blog<http://www.simplesignal.com/blog>
| Facebook <http://www.facebook.com/SimpleSignal?ref=ts> |
Twitter<http://twitter.com/simplesignal>
On Mon, Aug 27, 2012 at 2:46 PM, Karl Putland <[email protected]> wrote:
> Can keywords search be made case insensitive?
>
> Thanks,
>
> --Karl
>
> Karl Putland
> Senior VoIP Engineer
>
> *SimpleSignal*
> 3600 S Yosemite, Suite 150
> Denver, CO 80237
> One Number Rings All My Phones: 303-242-8608
>
> SimpleSignal.com <http://www.simplesignal.com/> |
> Blog<http://www.simplesignal.com/blog>
> | Facebook <http://www.facebook.com/SimpleSignal?ref=ts> |
> Twitter<http://twitter.com/simplesignal>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://osl.uoregon.edu/pipermail/netdot-devel/attachments/20120829/6aebe83d/attachment-0001.html
------------------------------
Message: 4
Date: Wed, 29 Aug 2012 21:48:46 +0200
From: Erik Wenzel <[email protected]>
Subject: Re: [Netdot-devel] [Netdot - Bug #1679] module inserted in
transceiver port container is not bound to asset
To: Carlos Vicente <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1
Am 29.08.2012 um 21:13 schrieb Carlos Vicente:
> On 8/29/12 3:01 PM, Erik Wenzel wrote:
>> Hey Carlos,
>>
>> Am 29.08.2012 um 20:32 schrieb [email protected]:
>>
>>> I have just looked at the code again and can confirm that it does look for
>>> serial numbers in existing assets. I have just tested with a 6509 by
>>> setting the asset field in the module to NULL (the asset is still in the
>>> DB, but not associated with any module). After rediscovering, the
>>> association is made again.
>>>
>>> The only thing that could be going on is that the asset's product is not
>>> from the same manufacturer as the device, because it searches for a
>>> combination of serial number and manufacturer.
>> I can confirm that the module is from a different manufacturer.
>>
>
> Well, that's the reason then.
>
> That poses an interesting challenge. If we only look for an asset with
> the given serial number, how to make sure that we are assigning the
> right asset? There is the possibility that two manufacturers could use
> the same serial numbers for their different products.
>
> hmmm...
So, there can't be a perfect solution. I like to suggest a practical solution.
If it really happens mark it on import of the second module and let the owner
decide from which manufacturer it is.
------------------------------
Message: 5
Date: Wed, 29 Aug 2012 15:58:19 -0400
From: Carlos Vicente <[email protected]>
Subject: Re: [Netdot-devel] [Netdot - Bug #1679] module inserted in
transceiver port container is not bound to asset
To: Erik Wenzel <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
On 8/29/12 3:48 PM, Erik Wenzel wrote:
>
> Am 29.08.2012 um 21:13 schrieb Carlos Vicente:
>
>> On 8/29/12 3:01 PM, Erik Wenzel wrote:
>>> Hey Carlos,
>>>
>>> Am 29.08.2012 um 20:32 schrieb [email protected]:
>>>
>>>> I have just looked at the code again and can confirm that it does look for
>>>> serial numbers in existing assets. I have just tested with a 6509 by
>>>> setting the asset field in the module to NULL (the asset is still in the
>>>> DB, but not associated with any module). After rediscovering, the
>>>> association is made again.
>>>>
>>>> The only thing that could be going on is that the asset's product is not
>>>> from the same manufacturer as the device, because it searches for a
>>>> combination of serial number and manufacturer.
>>> I can confirm that the module is from a different manufacturer.
>>>
>>
>> Well, that's the reason then.
>>
>> That poses an interesting challenge. If we only look for an asset with
>> the given serial number, how to make sure that we are assigning the
>> right asset? There is the possibility that two manufacturers could use
>> the same serial numbers for their different products.
>>
>> hmmm...
> So, there can't be a perfect solution. I like to suggest a practical
> solution. If it really happens mark it on import of the second module and let
> the owner decide from which manufacturer it is.
>
Try the following patch and let me know.
commit 599ddac8f21a44b33e8e042a6c513a658f16b26d
Author: Carlos Vicente <[email protected]>
Date: Wed Aug 29 15:57:18 2012 -0400
Find module asset from manufacturer different than device's
diff --git a/lib/Netdot/Model/Device.pm b/lib/Netdot/Model/Device.pm
index d971927..6a45092 100644
--- a/lib/Netdot/Model/Device.pm
+++ b/lib/Netdot/Model/Device.pm
@@ -5413,6 +5413,12 @@ sub _update_modules {
# from the name in the module information
$asset = Asset->search_sn_mf($serial, $mf)->first;
+ # The asset can unfortunately be from a different
+ # manufacturer. We run the risk of assigning the
+ # wrong asset, but the alternative may be worse
+ $asset = Asset->search(serial_number=>$serial)->first
+ unless $asset;
+
if ( !$asset && (my $model = $mod_args{model}) ){
# Now, search for the asset based on the match
# of both the product and either the name or
--
cv
------------------------------
Message: 6
Date: Wed, 29 Aug 2012 13:27:11 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] UNNAMED PROJECT branch netdot-1.0
updated. netdot-1.0.1-16-g599ddac
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 "UNNAMED PROJECT".
The branch, netdot-1.0 has been updated
via 599ddac8f21a44b33e8e042a6c513a658f16b26d (commit)
via 465c369e4b044bf7730a2931e1f738bc30b751d2 (commit)
via 49f07b92a37210f9c5c8f0850e03795502db1adf (commit)
from 68162a7c7646141acd270701aa048cdf11290b07 (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 599ddac8f21a44b33e8e042a6c513a658f16b26d
Author: Carlos Vicente <[email protected]>
Date: Wed Aug 29 15:57:18 2012 -0400
Find module asset from manufacturer different than device's
diff --git a/lib/Netdot/Model/Device.pm b/lib/Netdot/Model/Device.pm
index d971927..6a45092 100644
--- a/lib/Netdot/Model/Device.pm
+++ b/lib/Netdot/Model/Device.pm
@@ -5413,6 +5413,12 @@ sub _update_modules {
# from the name in the module information
$asset = Asset->search_sn_mf($serial, $mf)->first;
+ # The asset can unfortunately be from a different
+ # manufacturer. We run the risk of assigning the
+ # wrong asset, but the alternative may be worse
+ $asset = Asset->search(serial_number=>$serial)->first
+ unless $asset;
+
if ( !$asset && (my $model = $mod_args{model}) ){
# Now, search for the asset based on the match
# of both the product and either the name or
commit 465c369e4b044bf7730a2931e1f738bc30b751d2
Author: Carlos Vicente <[email protected]>
Date: Wed Aug 29 15:07:08 2012 -0400
Avoid duplicate errors when inserting Juniper modules
diff --git a/lib/Netdot/Model/Device.pm b/lib/Netdot/Model/Device.pm
index 0780fe6..d971927 100644
--- a/lib/Netdot/Model/Device.pm
+++ b/lib/Netdot/Model/Device.pm
@@ -944,7 +944,9 @@ sub get_snmp_info {
if ( $self->config->get('GET_DEVICE_MODULE_INFO') ){
foreach my $key ( keys %{ $hashes{e_class} } ){
- $dev{module}{$key}{number} = $hashes{e_index}->{$key};
+ # Notice that we use int() to avoid duplicate errors
+ # in DB when number is like 01000000
+ $dev{module}{$key}{number} = int($hashes{e_index}->{$key});
foreach my $field ( keys %MFIELDS ){
my $method = $MFIELDS{$field};
my $v = $hashes{$method}->{$key};
commit 49f07b92a37210f9c5c8f0850e03795502db1adf
Author: Carlos Vicente <[email protected]>
Date: Wed Aug 29 14:03:18 2012 -0400
Fixed problem when setting device site
diff --git a/htdocs/management/device.html b/htdocs/management/device.html
index 669c79e..69006d6 100644
--- a/htdocs/management/device.html
+++ b/htdocs/management/device.html
@@ -453,7 +453,10 @@ push( @cell_data, &{sub{
}} );
-my @rooms = sort { $a->name cmp $b->name } $o->site->rooms if $o->site;
+my @rooms;
+if ( $o->site ){
+ @rooms = sort { $a->name cmp $b->name } $o->site->rooms;
+}
push( @field_headers, $ui->col_descr_link('Device', 'room', 'Room:') );
push( @cell_data, &{sub{
$ui->select_lookup(object=>$o, column=>"room", lookup=>"Room",
diff --git a/lib/Netdot/UI.pm b/lib/Netdot/UI.pm
index 1234065..0fb5ed2 100644
--- a/lib/Netdot/UI.pm
+++ b/lib/Netdot/UI.pm
@@ -507,7 +507,8 @@ sub select_lookup{
my $table = ($o ? $o->short_class : $args{table});
$self->throw_fatal("Need to specify table and field to look up") unless (
$args{lookup} && $column );
- my @defaults = @{$args{defaults}} if $args{defaults};
+ my @defaults;
+ @defaults = @{$args{defaults}} if (defined $args{defaults} &&
ref($args{defaults}) eq 'ARRAY');
my $output;
-----------------------------------------------------------------------
Summary of changes:
htdocs/management/device.html | 5 ++++-
lib/Netdot/Model/Device.pm | 10 +++++++++-
lib/Netdot/UI.pm | 3 ++-
3 files changed, 15 insertions(+), 3 deletions(-)
hooks/post-receive
--
UNNAMED PROJECT
------------------------------
Message: 7
Date: Thu, 30 Aug 2012 11:07:21 -0400
From: Carlos Vicente <[email protected]>
Subject: Re: [Netdot-devel] keywords search case sensitivity
To: Karl Putland <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Thanks,
I have applied the patch, but only for Pg, as MySQL's default collation
is case insensitive.
cv
On 8/29/12 3:48 PM, Karl Putland wrote:
> Make search_like case insensitive.
> This improves usability for me and my users.
>
>
> diff -u Netdot.orig/Model.pm Netdot/Model.pm
> --- Netdot.orig/Model.pm2012-08-29 19:31:39.323838352 +0000
> +++ Netdot/Model.pm2012-08-29 19:45:08.559831642 +0000
> @@ -531,10 +531,10 @@
> } else {
> # Fix lack of typecast introduced in Pg 8.x
> if (Netdot->config->get('DB_TYPE') eq "Pg") {
> - push @qual, "CAST($column AS text) LIKE ?";
> + push @qual, "UPPER(CAST($column AS text)) LIKE
> UPPER(?)";
> push @bind, $value;
> } else {
> - push @qual, "$column LIKE ?";
> + push @qual, "UPPER($column) LIKE UPPER(?)";
> push @bind, $value;
> }
> }
>
> --Karl
>
> Karl Putland
> Senior VoIP Engineer
------------------------------
_______________________________________________
Netdot-devel mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-devel
End of Netdot-devel Digest, Vol 65, Issue 23
********************************************