Bug 743407 - API system.getDmi() returns a traceback when BIOS field is null into database
Summary: API system.getDmi() returns a traceback when BIOS field is null into database
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: API
Version: 1.6
Hardware: All
OS: All
medium
medium
Target Milestone: ---
Assignee: Jan Pazdziora (Red Hat)
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space16
TreeView+ depends on / blocked
 
Reported: 2011-10-04 19:53 UTC by Marcelo Moreira de Mello
Modified: 2011-12-22 16:47 UTC (History)
2 users (show)

Fixed In Version: spacewalk-java-1.6.57-1
Clone Of:
: 743434 (view as bug list)
Environment:
Last Closed: 2011-12-22 16:47:24 UTC
Embargoed:


Attachments (Terms of Use)
patch proposed (907 bytes, patch)
2011-10-04 22:20 UTC, Marcelo Moreira de Mello
no flags Details | Diff
patch proposed (1.75 KB, patch)
2011-10-05 20:16 UTC, Marcelo Moreira de Mello
no flags Details | Diff
patch proposed (3.09 KB, patch)
2011-10-06 23:29 UTC, Marcelo Moreira de Mello
no flags Details | Diff

Description Marcelo Moreira de Mello 2011-10-04 19:53:15 UTC
+++ This bug was initially created as a clone of Bug #741476 +++

Description of problem:
API system.getDmi() method does not return any value if some row at DB is null 


Version-Release number of selected component (if applicable):
Spacewalk 1.6 Nightly Version


How reproducible:
100%


Steps to Reproduce:
 
  Reproducer available at BZ#741476

+++++++++++++++++++++++=


# python api-dmi.py

 { .. SNIP .. }

1000010003
{'product': '', 'vendor': '', 'bios_vendor': '', 'system': 'SYSTEM_MANUAL_FILLED', 'bios_release': '', 'board': '', 'bios_version': '1.17', 'asset': ''}
********************

  Changing DB: 

SQL> update rhnserverdmi set BIOS_VERSION = '' where SERVER_ID = 1000010003;

1 row updated.


SQL> select ID, BIOS_VENDOR, BIOS_VERSION, BIOS_RELEASE from rhnserverdmi where SERVER_ID = 1000010003;

	ID BIOS_VENDOR			  BIOS_VERSION	       BIOS_RELEASE
---------- ------------------------------ -------------------- ---------------
       184

SQL> select ID, SERVER_ID, VENDOR, SYSTEM, PRODUCT from rhnserverdmi whereSERVER_ID = 1000010003;  

	ID  SERVER_ID VENDOR			     SYSTEM				      PRODUCT
---------- ---------- ------------------------------ ---------------------------------------- --------------------------------------------------
       184 1000010003				     SYSTEM_MANUAL_FILLED

=================// ===================// =========

Executing python script: 


# python api-dmi.py

 { .. SNIP .. }

Traceback (most recent call last):
  File "api-dmi.py", line 12, in <module>
    sys_dmi = server.system.getDmi(token,int(system['id']))
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1570, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1297, in single_request
    return self.parse_response(response)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1462, in parse_response
    p.feed(data)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 557, in feed
    self._parser.Parse(data, 0)
xml.parsers.expat.ExpatError: XML or text declaration not at start of entity: line 1, column 76

Comment 1 Marcelo Moreira de Mello 2011-10-04 19:53:47 UTC
Taking...

Comment 2 Marcelo Moreira de Mello 2011-10-04 22:20:40 UTC
Created attachment 526336 [details]
patch proposed

 Hello, 

 Follow a patch addressed to this BZ. Created an test package and worked as
expected.

 Patch already sent to spacewalk-devel maillist 

   Mail Thread: 
     https://www.redhat.com/archives/spacewalk-devel/2011-October/msg00001.html

 Best, 
mmello

Comment 3 Marcelo Moreira de Mello 2011-10-05 20:16:07 UTC
Created attachment 526571 [details]
patch proposed


 Better looking patch

Comment 4 Marcelo Moreira de Mello 2011-10-06 23:29:22 UTC
Created attachment 526818 [details]
patch proposed

Hello, 

  Mail thread -> https://www.redhat.com/archives/spacewalk-devel/2011-October/msg00009.html

Comment 5 Jan Pazdziora (Red Hat) 2011-10-10 08:26:26 UTC
Fixed in Spacewalk master, 6742bdedf6669d146316da043048ab16f0862ca9.

Comment 6 Milan Zázrivec 2011-12-22 16:47:24 UTC
Spacewalk 1.6 has been released.


Note You need to log in before you can comment on or make changes to this bug.