Bug 881597

Summary: [storage.py] Miss some log info in ovirt.log by using function "logging.info"
Product: Red Hat Enterprise Linux 6 Reporter: haiyang,dong <hadong>
Component: ovirt-nodeAssignee: Joey Boggs <jboggs>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 6.4CC: acathrow, bsarathy, cboyle, cshao, gouyang, hadong, jboggs, leiwang, lnovich, mburns, ovirt-maint, ycui
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-node-3.0.1-4.el6 Doc Type: Bug Fix
Doc Text:
Some information in ovirt.log was being missed due to using an incorrect function, logging.info("") this has been rectified using the correct function logger.info("") to record all log information in ovirt.log.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-21 19:16:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description haiyang,dong 2012-11-29 07:43:14 UTC
Description of problem:
Miss some log info in ovirt.log by using function "logging.info".
Should change "logging.info" into "logger.info".
Also better to change the position between "    logging.info(("Setting value for %s to %s " %
                             (self.__dict__[i_short], OVIRT_VARS[i])))"
and "i_short = i_short.replace("MIN_", "")"


Maybe using the follow patch can resole this issue:
   if i in OVIRT_VARS:
                if int(OVIRT_VARS[i]) < int(self.__dict__[i_short]):
                    logger.error(("%s is smaller than minimum required size " +
                                 "of: %s") % (i, self.__dict__[i_short]))
                    print (("\n%s is smaller than minimum required size of: " +
                          "%s") % (i, self.__dict__[i_short]))
                    return False
                i_short = i_short.replace("MIN_", "")
                logger.info(("Setting value for %s to %s " %
                             (self.__dict__[i_short], OVIRT_VARS[i])))
                self.__dict__[i_short] = int(OVIRT_VARS[i])
            else:
                logger.info("Using default value for: %s" % i_short)


[root@localhost data]# diff storage.py.Old-Version storage.py.New-Version 
106c106,107
<                 logging.info(("Setting value for %s to %s " %
---
>                 i_short = i_short.replace("MIN_", "")
>                 logger.info(("Setting value for %s to %s " %
108d108
<                 i_short = i_short.replace("MIN_", "")
111c111
<                 logging.info("Using default value for: %s" % i_short)
---
>                 logger.info("Using default value for: %s" % i_short)
 

Version-Release number of selected component (if applicable):
rhev-hypervisor6-6.4-20121126.0.el6

How reproducible:
100% 
  
Steps to Reproduce:


Actual result:

Expect result:

Comment 9 haiyang,dong 2013-10-23 11:31:00 UTC
Test version:
rhev-hypervisor6-6.5-20131017.0.iso
ovirt-node-3.0.1-4.el6

Could see the follow log info in ovirt.log
-------------------------
.......
2013-10-23 02:25:26,115 - INFO - storage - Using default value for: BOOT_SIZE
2013-10-23 02:25:26,115 - INFO - storage - Setting value for 256 to 256
2013-10-23 02:25:26,115 - INFO - storage - Setting value for 5 to 5
2013-10-23 02:25:26,115 - INFO - storage - Setting value for 5 to 2048
2013-10-23 02:25:26,115 - INFO - storage - Setting value for -1 to -1
2013-10-23 02:25:26,115 - INFO - storage - Using default value for: SWAP2_SIZE
2013-10-23 02:25:26,115 - INFO - storage - Using default value for: DATA2_SIZE
2013-10-23 02:25:26,116 - INFO - storage - Setting value for 256 to 256
.......

so this bug has been fixed, change the status into "VERIFIED"

Comment 12 Cheryn Tan 2013-11-08 00:38:42 UTC
This bug is currently attached to errata RHBA-2013:15277. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag.

Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information:

* Cause: What actions or circumstances cause this bug to present.
* Consequence: What happens when the bug presents.
* Fix: What was done to fix the bug.
* Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore')

Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug.

For further details on the Cause, Consequence, Fix, Result format please refer to:

https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes 

Thanks in advance.

Comment 13 Charlie 2013-11-12 04:52:08 UTC
Not quite sure what the problem was. Would you clarify it for the errata text?

Comment 14 haiyang,dong 2013-11-12 05:47:16 UTC
(In reply to Charlie from comment #13)
> Not quite sure what the problem was. Would you clarify it for the errata
> text?

This bug was describing about using wrong logging.info("") function to lead to miss some log info in ovirt.log.
Actually it should use logger.info("") not logging.info("") to record log info in ovirt.log.

Comment 16 errata-xmlrpc 2014-01-21 19:16:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0033.html