[node-patches] Change in ovirt-node[master]: utils_fs: make unpersist support symlinks

asegurap at redhat.com asegurap at redhat.com
Wed Jul 2 15:51:12 UTC 2014


Antoni Segura Puimedon has posted comments on this change.

Change subject: utils_fs: make unpersist support symlinks
......................................................................


Patch Set 4:

(1 comment)

http://gerrit.ovirt.org/#/c/29075/4/src/ovirt/node/utils/fs/__init__.py
File src/ovirt/node/utils/fs/__init__.py:

Line 557:         # Remove the original contents and replace them with what was persisted
Line 558:         # up until now
Line 559:         shutil.rmtree(abspath)
Line 560:         shutil.copytree(persisted_path, abspath, symlinks=True)
Line 561:         shutil.rmtree(persisted_path)
here we should call something like:

    def config_cleanup(path):
        shutil.rmtree(path)
        dirname = os.path.dirname(path)
        while True:
            try:
                os.rmdir(dirname)
            except OSError as ose:
                if ose.errno == errno.ENOTEMPTY:
                    break
                else:
                    raise

Otherwise we are going to leave trash empty directories in /config
Line 562:         self._del_path_entry(abspath)
Line 563:         self._logger.info('Successfully unpersisted directory "%s"' % abspath)
Line 564: 
Line 565:     def _unpersist_file(self, abspath):


-- 
To view, visit http://gerrit.ovirt.org/29075
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I719304b37a17dfc47427fe1c0bb9a4e14cb88a9b
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at fedoraproject.org>
Gerrit-Reviewer: Ryan Barry <rbarry 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