Bug 866299 - [python code]Persist function "ovirt_store_config" still print info "Successfully persisted" when persisted the inexisted file.
[python code]Persist function "ovirt_store_config" still print info "Successf...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ovirt-node (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Fabian Deutsch
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2012-10-15 00:24 EDT by haiyang,dong
Modified: 2013-02-28 11:33 EST (History)
12 users (show)

See Also:
Fixed In Version: ovirt-node-2.5.0-6.el6
Doc Type: Bug Fix
Doc Text:
After registering the hypervisor to Subscription Asset Manager and running the ovirt_store_config function, it was printed in ovirt.log that the /var/lib/rhsm/productid.js file was successfully persisted, even though the file did not exist in the hypervisor. ovirt_store_config has now been updated to skip the /var/lib/rhsm/productid.js file, so it is not listed in ovirt.log as a persisted file.
Story Points: ---
Clone Of:
Last Closed: 2013-02-28 11:33:43 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description haiyang,dong 2012-10-15 00:24:52 EDT
Description of problem:
Execute "ovirt_store_config("/var/lib/rhsm/productid.js")" to persist file, and actually the productid.js file didn't exist in RHEV-H,
but Persist function "ovirt_store_config" still print info "Successfully persisted: /var/lib/rhsm/productid.js" in the ovirt.log.

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

How reproducible:

Steps to Reproduce:
1. Install RHEV-H.
2. Register RHEV-H to SAM.

Actual results:
After Register RHEV-H to SAM successfully.
check that ovirt.log
2012-10-14 05:09:06,437 - WARNING - ovirtfunctions - Skipping, file: /var/lib/rhsm/productid.js does not exist
2012-10-14 05:09:06,444 - DEBUG - ovirtfunctions - mkdir -p /config//var/lib/rhsm
2012-10-14 05:09:06,444 - DEBUG - ovirtfunctions -
2012-10-14 05:09:06,448 - DEBUG - ovirtfunctions - cp -a /var/lib/rhsm/productid.js /config/var/lib/rhsm/productid.js
2012-10-14 05:09:06,448 - DEBUG - ovirtfunctions -
2012-10-14 05:09:06,448 - DEBUG - ovirtfunctions - cp: cannot stat `/var/lib/rhsm/productid.js': No such file or directory
2012-10-14 05:09:06,453 - INFO - ovirtfunctions - Successfully persisted: /var/lib/rhsm/productid.js

the file /var/lib/rhsm/productid.js didn't exit in rhev-h, but "ovirt_store_config" still print info "Successfully persisted: /var/lib/rhsm/productid.js" in the ovirt.log.

Expected results:
Persist function "ovirt_store_config" should print correct info when persisted the inexisted file

Additional info:
Comment 4 Fabian Deutsch 2012-10-15 16:09:09 EDT
Tested as follows:
>>> from ovirtnode.ovirtfunctions import *
>>> ovirt_store_config("/tmp/a")   # /tmp/a does exist

True is okay,and message about successfully persisted

>>> ovirt_store_config(["/tmp/a", "/tmp/b"])   # /tmp/[a,b} do exist

True is okay,and messages about successfully persisted

>>> ovirt_store_config("/tmp/ab")   # /tmp/ab doesn't exist

True is returned (same behavior as before) and "Skipping, file ... does not exist" in /var/log/ovirt.log

Comment 7 haiyang,dong 2012-10-28 22:10:49 EDT
Test version:

[root@localhost data]# ls /data/a
ls: cannot access /data/a: No such file or directory
[root@localhost data]# python
Python 2.6.6 (r266:84292, Oct 12 2012, 14:23:48) 
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ovirtnode.ovirtfunctions import *
>>> ovirt_store_config("/data/a")
>>> exit()
check that ovirt.log
2012-10-29 02:00:52,959 - DEBUG - ovirt-config-setup - {'breth0': ('', '')}
2012-10-29 02:00:52,992 - INFO - ovirtfunctions - Hardware virtualization detected
2012-10-29 02:03:38,602 - WARNING - ovirtfunctions - Skipping, file '/data/a' does not exist

Persist function "ovirt_store_config" won't print info "Successfully persisted" when persisted the inexisted file.

so this bug has been fixed.
Comment 8 haiyang,dong 2012-12-26 03:57:02 EST
so follow steps of comment 7 to re-test on version
rhev-hypervisor6-6.4-20121212.1.el6 , bug was fixed on it.
Comment 10 errata-xmlrpc 2013-02-28 11:33:43 EST
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.


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