Hello,

  Follow the patch which fixes the python traceback exception when the
when the fields BIOS_VENDOR and BIOS_RELEASE and BIOS_VERSION are blank
into database. The patch call the Class constructor if the object is null.
 
  Created a test package and worked as expected.

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

Best,
mmello

-- 
Marcelo Moreira de Mello
RHCA RHCSS RHCVA 
Senior Software Maintenance Engineer/SEG           

From: Marcelo Moreira de Mello <mme...@redhat.com>
Date: Wed, 5 Oct 2011 17:07:37 -0300
Subject: [PATCH] 743407 

  fixed the traceback from API call system.getDMI() when the fields BIOS_VENDOR 
and BIOS_RELEASE and BIOS_VERSION are blank into database

   Traceback:
-------------------------------------
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



 .../code/src/com/redhat/rhn/domain/server/Dmi.java |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/java/code/src/com/redhat/rhn/domain/server/Dmi.java 
b/java/code/src/com/redhat/rhn/domain/server/Dmi.java
index 45835bd..544eac7 100644
--- a/java/code/src/com/redhat/rhn/domain/server/Dmi.java
+++ b/java/code/src/com/redhat/rhn/domain/server/Dmi.java
@@ -59,7 +59,7 @@ public class Dmi extends BaseDomainHelper {
      * @return Returns the bios.
      */
     public Bios getBios() {
-        return bios;
+        return bios!=null?bios:new Bios();
     }
 
     /**
-- 
1.7.6.4

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to