Change in vdsm[master]: multipath: Write multipath.conf atomically

danken at redhat.com danken at redhat.com
Wed Sep 2 14:52:32 UTC 2015


Dan Kenigsberg has submitted this change and it was merged.

Change subject: multipath: Write multipath.conf atomically
......................................................................


multipath: Write multipath.conf atomically

We used to create a temporary file, and then copy (using cp) the
temporary file to final location.  Using external process to copy files
on local storage is not needed, we can use the Python standard library
for that. Also, this operation is not atomic, and can leave half written
file if the write is interrupted in the middle.

Now we use NamedTemporaryFile(delete=False), to create a temporary file
safely, but do not delete it, so we can rename the file atomically.

Change-Id: I850d621b7cb09f2732b8b3eb2cb2897e87547ddb
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/44869
Reviewed-by: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M lib/vdsm/tool/configurators/multipath.py
1 file changed, 13 insertions(+), 9 deletions(-)

Approvals:
  Piotr Kliczewski: Looks good to me, but someone else must approve
  Nir Soffer: Verified
  Jenkins CI: Passed CI tests
  Dan Kenigsberg: Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I850d621b7cb09f2732b8b3eb2cb2897e87547ddb
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fdeutsch at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org


More information about the vdsm-patches mailing list