Bug 1259007 - Fail to unpersist file if not using full path
Fail to unpersist file if not using full path
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-node (Show other bugs)
3.5.4
x86_64 Linux
high Severity high
: ovirt-3.6.0-rc3
: 3.6.0
Assigned To: Fabian Deutsch
Virtualization Bugs
: ZStream
Depends On:
Blocks: 1263215
  Show dependency treegraph
 
Reported: 2015-09-01 14:01 EDT by Meni Yakove
Modified: 2016-03-09 09:36 EST (History)
6 users (show)

See Also:
Fixed In Version: ovirt-node-3.3.0-0.10.20150928gite7ee3f1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1263215 (view as bug list)
Environment:
Last Closed: 2016-03-09 09:36:21 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Node
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 45795 master MERGED fs: Use the abspath to check persistence Never
oVirt gerrit 46161 ovirt-3.6 MERGED fs: Use the abspath to check persistence Never
oVirt gerrit 46179 ovirt-3.5 MERGED fs: Use the abspath to check persistence Never

  None (edit)
Description Meni Yakove 2015-09-01 14:01:05 EDT
Description of problem:
unpersist file fails if not using full file path


[root@puma26 tmp]# cd /etc/sysconfig/network-scripts/
[root@puma26 network-scripts]# touch test
[root@puma26 network-scripts]# persist test
Successfully persisted: test
[root@puma26 network-scripts]# unpersist test
File not explicitly persisted: test
[root@puma26 network-scripts]# unpersist /etc/sysconfig/network-scripts/test 
/etc/sysconfig/network-scripts/test successully unpersisted


Version-Release number of selected component (if applicable):
Red Hat Enterprise Virtualization Hypervisor release 7.1
Red Hat Enterprise Virtualization Hypervisor release 6.7 (20150828.0.el6ev)

How reproducible:
100%

Steps to Reproduce:
1. cd /etc/sysconfig/network-scripts/
2. touch test 
3. persist test
4. unpersist test



Additional info:
in /usr/sbin/unpersist
if not conf.exists(path) probeblly returs False when not using full path

from ovirt.node.utils import fs
conf = fs.Config()
conf.exists('/etc/sysconfig/network-scripts/test')
True
>>> conf.exists('network-scripts/test')
False

os.system('pwd')
/etc/sysconfig

os.path.isfile('network-scripts/test')
True
Comment 3 Huijuan Zhao 2015-10-10 01:25:50 EDT
Test version:
rhev-hypervisor7-7.2-20150928.0.iso
ovirt-node-3.3.0-0.10.20150928gite7ee3f1.el7ev.noarch

Test steps:
1. Clean install rhev-hypervisor7-7.2-20150928.0.iso
2. Press "F2" enter to shell
3. cd /etc/sysconfig/network-scripts/
4. touch test 
5. persist test
6. unpersist test
7. persist test
8. unpersist /etc/sysconfig/network-scripts/test

Test result:
After step5, Successfully persisted: test
After step6, test successully unpersisted
After step7, Successfully persisted: test
After step8, /etc/sysconfig/network-scripts/test successully unpersisted

This bug has been fixed, change the status to VERIFIED.
Comment 5 errata-xmlrpc 2016-03-09 09:36:21 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.

https://rhn.redhat.com/errata/RHBA-2016-0378.html

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