Send Netdot-users mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://osl.uoregon.edu/mailman/listinfo/netdot-users
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-users digest..."


Today's Topics:

   1. Re : Re:  RE : Problem updating device info (Blakkheim.GW)
   2. Re: Re : Re:  RE : Problem updating device info (Carlos Vicente)


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

Message: 1
Date: Tue, 02 Oct 2012 12:11:48 +0200
From: "Blakkheim.GW" <[email protected]>
Subject: [Netdot-users] Re : Re:  RE : Problem updating device info
To: "Carlos Vicente" <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Hello,

The patch works and the device is added and updated correctly.

Regards.


> ----- Message d'origine -----
> De : Carlos Vicente
> Envoy?s : 28.09.12 17:42
> ? : Blakkheim.GW
> Objet : Re: [Netdot-users] RE : Problem updating device info
> 
> Hi,
> 
> I think I may have found the bug. If you'd like to try, here are the
> changes in Device.pm (the line numbers will not match yours exactly):
> 
> -- cut -------------------------------------------------------------
> diff --git a/lib/Netdot/Model/Device.pm b/lib/Netdot/Model/Device.pm
> index ef4e94a..aa285f4 100644
> --- a/lib/Netdot/Model/Device.pm
> +++ b/lib/Netdot/Model/Device.pm
> @@ -5486,16 +5486,20 @@ sub _update_modules {
> ?-or => [part_number => $model, name => $model],
> ?})->first;
> 
> - $product ||= Product->insert({part_number => $model,
> - name => $model,
> - manufacturer => $mf,
> - });
> + my $type = ProductType->find_or_create({name=>'Module'});
> 
> - if ( !$product->type || $product->type->name eq 'Unknown' ){
> - my $type =
> ProductType->find_or_create({name=>'Module'});
> - $product->update({type => $type});
> + if ( $product ){
> + if ( !$product->type || $product->type->name eq
> 'Unknown' ){
> + $product->update({type => $type});
> + }
> + }else{
> + $product = Product->insert({part_number => $model,
> + name => $model,
> + manufacturer => $mf,
> + type => $type,
> + });
> ?}
> -
> +
> ?# Find or create asset
> ?$asset = Asset->find_or_create({product_id => $product,
> ?serial_number => $serial,
> -- cut -------------------------------------------------------------
> 
> 
> Let me know.
> 
> 
> On 9/28/12 4:24 AM, Blakkheim.GW wrote:
> > Hello,
> > 
> > No one has ideas about this problem ? It is a blocking bug as we
> > can't add our new network equipments.
> > 
> > It appears when I try to add the chassis but despite the error, the
> > device is added to Netdot, but incompletely. And when I try to update
> > the device, the error is here again.
> > 
> > Thanks.
> > 
> > 
> >> ----- Message d'origine ----- De : Blakkheim.GW Envoy?s : 25.09.12
> >> 17:42 ? : [email protected] Objet : Problem updating
> >> device info
> >> 
> >> Hello,
> >> 
> >> I use latest Netdot version.
> >> 
> >> When I try to update a device (HP chassis 8200ZL), using CLI or web
> >> interface, I get this error :
> >> 
> >> 
> >> 
> >> ERROR: Error while inserting Product: Some fields cannot be null
> >> 
> >> Error details: Can't insert new Product: DBD::mysql::st execute
> >> failed: Column 'type' cannot be null [for Statement "INSERT INTO
> >> product (part_number, manufacturer, name, type) VALUES (?, ?, ?,
> >> ?) " with ParamValues: 0='SG210BQ07D', 1='3', 2='SG210BQ07D',
> >> 3=undef] at /usr/share/perl5/DBIx/ContextualFetch.pm line 52. at
> >> /opt/netdot/lib/Netdot/Model/Device.pm line 5430
> >> 
> >> 
> >> 
> >> Any ideas ?
> >> 
> >> Thanks.
> >> 
> >> -- Blakkheim.GW Last.fm profile :
> >> http://www.lastfm.fr/user/BlakkheimGW
> > 
> > 
> > -- Blakkheim.GW Last.fm profile :
> > http://www.lastfm.fr/user/BlakkheimGW 
> > _______________________________________________ Netdot-users mailing
> > list [email protected] 
> > https://osl.uoregon.edu/mailman/listinfo/netdot-users
> > 
> 
> 
> -- 
> cv


--
Blakkheim.GW
Last.fm profile : http://www.lastfm.fr/user/BlakkheimGW


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

Message: 2
Date: Tue, 02 Oct 2012 10:30:00 -0400
From: Carlos Vicente <[email protected]>
Subject: Re: [Netdot-users] Re : Re:  RE : Problem updating device
        info
To: "Blakkheim.GW" <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

Great. Thanks.

cv

On 10/2/12 6:11 AM, Blakkheim.GW wrote:
> Hello,
> 
> The patch works and the device is added and updated correctly.
> 
> Regards.
> 
> 
>> ----- Message d'origine -----
>> De : Carlos Vicente
>> Envoy?s : 28.09.12 17:42
>> ? : Blakkheim.GW
>> Objet : Re: [Netdot-users] RE : Problem updating device info
>>
>> Hi,
>>
>> I think I may have found the bug. If you'd like to try, here are the
>> changes in Device.pm (the line numbers will not match yours exactly):
>>
>> -- cut -------------------------------------------------------------
>> diff --git a/lib/Netdot/Model/Device.pm b/lib/Netdot/Model/Device.pm
>> index ef4e94a..aa285f4 100644
>> --- a/lib/Netdot/Model/Device.pm
>> +++ b/lib/Netdot/Model/Device.pm
>> @@ -5486,16 +5486,20 @@ sub _update_modules {
>>  -or => [part_number => $model, name => $model],
>>  })->first;
>>
>> - $product ||= Product->insert({part_number => $model,
>> - name => $model,
>> - manufacturer => $mf,
>> - });
>> + my $type = ProductType->find_or_create({name=>'Module'});
>>
>> - if ( !$product->type || $product->type->name eq 'Unknown' ){
>> - my $type =
>> ProductType->find_or_create({name=>'Module'});
>> - $product->update({type => $type});
>> + if ( $product ){
>> + if ( !$product->type || $product->type->name eq
>> 'Unknown' ){
>> + $product->update({type => $type});
>> + }
>> + }else{
>> + $product = Product->insert({part_number => $model,
>> + name => $model,
>> + manufacturer => $mf,
>> + type => $type,
>> + });
>>  }
>> -
>> +
>>  # Find or create asset
>>  $asset = Asset->find_or_create({product_id => $product,
>>  serial_number => $serial,
>> -- cut -------------------------------------------------------------
>>
>>
>> Let me know.
>>
>>
>> On 9/28/12 4:24 AM, Blakkheim.GW wrote:
>>> Hello,
>>>
>>> No one has ideas about this problem ? It is a blocking bug as we
>>> can't add our new network equipments.
>>>
>>> It appears when I try to add the chassis but despite the error, the
>>> device is added to Netdot, but incompletely. And when I try to update
>>> the device, the error is here again.
>>>
>>> Thanks.
>>>
>>>
>>>> ----- Message d'origine ----- De : Blakkheim.GW Envoy?s : 25.09.12
>>>> 17:42 ? : [email protected] Objet : Problem updating
>>>> device info
>>>>
>>>> Hello,
>>>>
>>>> I use latest Netdot version.
>>>>
>>>> When I try to update a device (HP chassis 8200ZL), using CLI or web
>>>> interface, I get this error :
>>>>
>>>>
>>>>
>>>> ERROR: Error while inserting Product: Some fields cannot be null
>>>>
>>>> Error details: Can't insert new Product: DBD::mysql::st execute
>>>> failed: Column 'type' cannot be null [for Statement "INSERT INTO
>>>> product (part_number, manufacturer, name, type) VALUES (?, ?, ?,
>>>> ?) " with ParamValues: 0='SG210BQ07D', 1='3', 2='SG210BQ07D',
>>>> 3=undef] at /usr/share/perl5/DBIx/ContextualFetch.pm line 52. at
>>>> /opt/netdot/lib/Netdot/Model/Device.pm line 5430
>>>>
>>>>
>>>>
>>>> Any ideas ?
>>>>
>>>> Thanks.
>>>>
>>>> -- Blakkheim.GW Last.fm profile :
>>>> http://www.lastfm.fr/user/BlakkheimGW
>>>
>>>
>>> -- Blakkheim.GW Last.fm profile :
>>> http://www.lastfm.fr/user/BlakkheimGW 
>>> _______________________________________________ Netdot-users mailing
>>> list [email protected] 
>>> https://osl.uoregon.edu/mailman/listinfo/netdot-users
>>>
>>
>>
>> -- 
>> cv
> 
> 
> --
> Blakkheim.GW
> Last.fm profile : http://www.lastfm.fr/user/BlakkheimGW
> 


-- 
cv


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

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


End of Netdot-users Digest, Vol 47, Issue 1
*******************************************

Reply via email to