[node-patches] Change in ovirt-node[master]: persist: fix owner/group copy to /config

fabiand at redhat.com fabiand at redhat.com
Tue Mar 24 13:14:15 UTC 2015


Fabian Deutsch has posted comments on this change.

Change subject: persist: fix owner/group copy to /config
......................................................................


Patch Set 1: Code-Review+2

(1 comment)

https://gerrit.ovirt.org/#/c/39068/1/src/ovirt/node/utils/fs/__init__.py
File src/ovirt/node/utils/fs/__init__.py:

Line 484:                 except OSError as ose:
Line 485:                     self._logger.error('Failed to clean up persisted file '
Line 486:                                        '"%s": %s', abspath, ose.message)
Line 487:         self._prepare_dir(abspath, persisted_path)
Line 488:         abspath_stat = os.stat(abspath)
This will solve the issue for wrong permissions for files, ut we also need to take care of:
selinux and dirs and symlinks, so please:

factor out a method which takes two paths, and is then taking care of ownership and selinux (copy both form src to dst)
Line 489:         owner = abspath_stat[stat.ST_UID]
Line 490:         group = abspath_stat[stat.ST_GID]
Line 491:         shutil.copy2(abspath, persisted_path)
Line 492:         os.chown(persisted_path, owner, group)


-- 
To view, visit https://gerrit.ovirt.org/39068
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4ec3dc1773a0e84eb82c2682f9e145c15216dd91
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes



More information about the node-patches mailing list