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. [Netdot - Bug #1848] REST meta_data resouce broken
      ([email protected])


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

Message: 1
Date: Tue, 18 Aug 2015 13:08:09 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1848] REST meta_data resouce
        broken
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1848 has been updated by moe kraus.


Hi Matej,

Thanks for the Patch. I ran into this while implementing an API client.

Also other  resources are affected by this bug.

Regards
Moe
----------------------------------------
Bug #1848: REST meta_data resouce broken
https://osl.uoregon.edu/redmine/issues/1848#change-3312

Author: Matej Vadnjal
Status: New
Priority: Low
Assignee: 
Category: RestAPI
Target version: 
Resolution: 


Calling REST resource /netdot/rest/device/meta_data results in an exception:

<pre>
Can't encode a value of type: SCALAR at /opt/netdot/lib/Netdot/REST.pm line 496


Trace begun at /usr/share/perl5/HTML/Mason/Exceptions.pm line 129
HTML::Mason::Exceptions::rethrow_exception('Can\'t encode a value of type: 
SCALAR at /opt/netdot/lib/Netdot/REST.pm line 496^J') called at 
/usr/share/perl5/Carp.pm line 44
Carp::croak('Can\'t encode a value of type: SCALAR') called at 
/usr/share/perl5/XML/Simple.pm line 1616
XML::Simple::value_to_xml('XML::Simple=HASH(0x7f4d43fc82b8)', 
'SCALAR(0x7f4d40627ff0)', 'default', '    ') called at 
/usr/share/perl5/XML/Simple.pm line 1544
XML::Simple::value_to_xml('XML::Simple=HASH(0x7f4d43fc82b8)', 
'HASH(0x7f4d4147b268)', 'columns', '  ') called at 
/usr/share/perl5/XML/Simple.pm line 1597
XML::Simple::value_to_xml('XML::Simple=HASH(0x7f4d43fc82b8)', 
'HASH(0x7f4d407d68e0)', 'columns', '  ') called at 
/usr/share/perl5/XML/Simple.pm line 1544
XML::Simple::value_to_xml('XML::Simple=HASH(0x7f4d43fc82b8)', 
'HASH(0x7f4d414735b8)', 'opt', '') called at /usr/share/perl5/XML/Simple.pm 
line 620
XML::Simple::XMLout('XML::Simple=HASH(0x7f4d43fc82b8)', 'HASH(0x7f4d414735b8)') 
called at /opt/netdot/lib/Netdot/REST.pm line 496
Netdot::REST::print_serialized('Netdot::REST=HASH(0x7f4d43fc6558)', 
'HASH(0x7f4d414735b8)') called at /opt/netdot/lib/Netdot/REST.pm line 173
Netdot::REST::handle_resource('Netdot::REST=HASH(0x7f4d43fc6558)', 'resource', 
'device/meta_data', 'r', 'Apache2::Request=SCALAR(0x7f4d43fae280)') called at 
/opt/netdot/htdocs/rest/dhandler line 35
eval {...} at /opt/netdot/htdocs/rest/dhandler line 34
HTML::Mason::Commands::__ANON__('showheader', 1, 'user', 
'Apache2::SiteControl::User=HASH(0x7f4d44406930)', 'manager', 
'Apache2::SiteControl::PermissionManager=HASH(0x7f4d436c8d70)') called at 
/usr/share/perl5/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x7f4d4431c900)',
 'showheader', 1, 'user', 'Apache2::SiteControl::User=HASH(0x7f4d44406930)', 
'manager', 'Apache2::SiteControl::PermissionManager=HASH(0x7f4d436c8d70)') 
called at /usr/share/perl5/HTML/Mason/Request.pm line 1284
eval {...} at /usr/share/perl5/HTML/Mason/Request.pm line 1274
HTML::Mason::Request::comp(undef, undef, undef, 'showheader', 1, 'user', 
'Apache2::SiteControl::User=HASH(0x7f4d44406930)', 'manager', 
'Apache2::SiteControl::PermissionManager=HASH(0x7f4d436c8d70)') called at 
/usr/share/perl5/HTML/Mason/Request.pm line 943
HTML::Mason::Request::call_next('HTML::Mason::Request::ApacheHandler=HASH(0x7f4d442e11f8)',
 'user', 'Apache2::SiteControl::User=HASH(0x7f4d44406930)', 'manager', 
'Apache2::SiteControl::PermissionManager=HASH(0x7f4d436c8d70)') called at 
/opt/netdot/htdocs/rest/autohandler line 27
eval {...} at /opt/netdot/htdocs/rest/autohandler line 26
HTML::Mason::Commands::__ANON__('showheader', 1) called at 
/usr/share/perl5/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x7f4d4431ea28)',
 'showheader', 1) called at /usr/share/perl5/HTML/Mason/Request.pm line 1284
eval {...} at /usr/share/perl5/HTML/Mason/Request.pm line 1274
HTML::Mason::Request::comp(undef, undef, undef, 'showheader', 1) called at 
/usr/share/perl5/HTML/Mason/Request.pm line 943
HTML::Mason::Request::call_next('HTML::Mason::Request::ApacheHandler=HASH(0x7f4d442e11f8)',
 'showheader', 1) called at /opt/netdot/htdocs/autohandler line 76
HTML::Mason::Commands::__ANON__ at /usr/share/perl5/HTML/Mason/Component.pm 
line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x7f4d436b08b8)')
 called at /usr/share/perl5/HTML/Mason/Request.pm line 1279
eval {...} at /usr/share/perl5/HTML/Mason/Request.pm line 1274
HTML::Mason::Request::comp(undef, undef, undef) called at 
/usr/share/perl5/HTML/Mason/Request.pm line 473
eval {...} at /usr/share/perl5/HTML/Mason/Request.pm line 473
eval {...} at /usr/share/perl5/HTML/Mason/Request.pm line 425
HTML::Mason::Request::exec('HTML::Mason::Request::ApacheHandler=HASH(0x7f4d442e11f8)')
 called at /usr/share/perl5/HTML/Mason/ApacheHandler.pm line 168
HTML::Mason::Request::ApacheHandler::exec('HTML::Mason::Request::ApacheHandler=HASH(0x7f4d442e11f8)')
 called at /usr/share/perl5/HTML/Mason/ApacheHandler.pm line 825
HTML::Mason::ApacheHandler::handle_request('HTML::Mason::ApacheHandler=HASH(0x7f4d4367fc28)',
 'Apache2::RequestRec=SCALAR(0x7f4d443f4930)') called at 
/opt/netdot/lib/Netdot/Mason.pm line 59
Netdot::Mason::handler('Apache2::RequestRec=SCALAR(0x7f4d443f4930)') called at 
-e line 0
eval {...} at -e line 0
</pre>

The problem is a side effect of this commit:
https://github.com/cvicente/Netdot/commit/c778e6f482efdb89945356f8de048a4062507267

XML::Simple does not know how to serialize scalar refs (eg \"FALSE").

So I wrote a small patch that will dereference any scalar refs and replace TRUE 
and FALSE with 1 and 0.




-- 
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 101, Issue 1
********************************************

Reply via email to