Bug 866300 - [python code] Persist function "ovirt_store_config" persisted the list files failed.
[python code] Persist function "ovirt_store_config" persisted the list files ...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ovirt-node (Show other bugs)
6.3
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Fabian Deutsch
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-15 00:30 EDT by haiyang,dong
Modified: 2013-02-28 11:40 EST (History)
12 users (show)

See Also:
Fixed In Version: ovirt-node-2.5.0-6.el6
Doc Type: Bug Fix
Doc Text:
Previously an indent level was missing for the ovirt_store_config function, so only the last filename was persisted. The logic for the ovirt_store_config function has been updated, and the indent level has been corrected so all required files are persisted.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-28 11:40:26 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0556 normal SHIPPED_LIVE ovirt-node bug fix and enhancement update 2013-02-28 16:29:06 EST

  None (edit)
Description haiyang,dong 2012-10-15 00:30:46 EDT
Description of problem:
Persist function "ovirt_store_config" persisted the list files failed.

Version-Release number of selected component (if applicable):
rhev-hypervisor6-6.3-20121012.0.el6_3

How reproducible:
100%

Steps to Reproduce:
[root@localhost data]# touch a
[root@localhost data]# touch b
[root@localhost data]# python
Python 2.6.6 (r266:84292, Aug 28 2012, 10:55:56)
[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 *
>>> persisted_files_list = (["/data/a","/data/b"])
>>> print persisted_files_list
['/data/a', '/data/b']
>>> ovirt_store_config(persisted_files_list)
True
>>> exit()

tail -f ovirt.log
----------------
2012-10-15 02:58:15,719 - INFO - ovirtfunctions - Hardware virtualization detected
2012-10-15 03:00:04,163 - DEBUG - ovirtfunctions - mkdir -p /config//data
2012-10-15 03:00:04,163 - DEBUG - ovirtfunctions -
2012-10-15 03:00:04,179 - DEBUG - ovirtfunctions - cp -a /data/a /config/data/a
2012-10-15 03:00:04,179 - DEBUG - ovirtfunctions -
2012-10-15 03:00:04,200 - DEBUG - ovirtfunctions - mount -n --bind /config/data/a /data/a
2012-10-15 03:00:04,200 - DEBUG - ovirtfunctions -
2012-10-15 03:00:04,200 - INFO - ovirtfunctions - File: /data/a persisted
2012-10-15 03:00:04,205 - INFO - ovirtfunctions - Successfully persisted: /data/a

[root@localhost data]# cat /config/files |tail -5
/etc/sysconfig/network-scripts/ifcfg-breth0
/etc/ntp.conf
/etc/udev/rules.d/71-persistent-node-net.rules
/etc/ssh/sshd_config
/data/a

so that the "ovirt_store_config" didn't persist the file "/data/b"
it only persisted /data/a
Persist function "ovirt_store_config" persisted the list files failed.

Expected results:
Persist function "ovirt_store_config" persisted the list files successfully.

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

True is okay,and message about successfully persisted


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

True is okay,and messages about successfully persisted


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

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

http://gerrit.ovirt.org/#/c/8585/
http://gerrit.ovirt.org/#/c/8586/
http://gerrit.ovirt.org/#/c/8587/
Comment 6 haiyang,dong 2012-10-28 22:18:31 EDT
Test version:
rhev-hypervisor6-6.4-20121015.1.el6
ovirt-node-2.5.0-7.el6_4.noarch

Tried:
[root@localhost data]# touch a
[root@localhost data]# touch b
[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 *
>>> persisted_files_list = (["/data/a","/data/b"])
>>> print persisted_files_list
['/data/a', '/data/b']
>>> ovirt_store_config(persisted_files_list)
True
>>> exit()
[root@localhost data]# cat /config/files |tail -5
/etc/rhsm/rhsm.conf
/var/lib/rhsm/cache/installed_products.json
/var/lib/rhsm/facts/facts.json
/data/a
/data/b

tail -f ovirt.log
------------------------
2012-10-29 02:13:44,102 - DEBUG - ovirtfunctions - mkdir -p /config//data
2012-10-29 02:13:44,102 - DEBUG - ovirtfunctions - 
2012-10-29 02:13:44,108 - DEBUG - ovirtfunctions - cp -a /data/a /config/data/a
2012-10-29 02:13:44,109 - DEBUG - ovirtfunctions - 
2012-10-29 02:13:44,120 - DEBUG - ovirtfunctions - mount -n --bind /config/data/a /data/a
2012-10-29 02:13:44,121 - DEBUG - ovirtfunctions - 
2012-10-29 02:13:44,121 - INFO - ovirtfunctions - File: /data/a persisted
2012-10-29 02:13:44,129 - INFO - ovirtfunctions - Successfully persisted: /data/a
2012-10-29 02:13:44,136 - DEBUG - ovirtfunctions - mkdir -p /config//data
2012-10-29 02:13:44,136 - DEBUG - ovirtfunctions - 
2012-10-29 02:13:44,140 - DEBUG - ovirtfunctions - cp -a /data/b /config/data/b
2012-10-29 02:13:44,140 - DEBUG - ovirtfunctions - 
2012-10-29 02:13:44,143 - DEBUG - ovirtfunctions - mount -n --bind /config/data/b /data/b
2012-10-29 02:13:44,144 - DEBUG - ovirtfunctions - 
2012-10-29 02:13:44,144 - INFO - ovirtfunctions - File: /data/b persisted
2012-10-29 02:13:44,150 - INFO - ovirtfunctions - Successfully persisted: /data/b

Persist function "ovirt_store_config" can persist the list files successfully.

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

http://rhn.redhat.com/errata/RHBA-2013-0556.html

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