[node-patches] Change in ovirt-node[master]: ovirt-node-upgrade: add lock file check to prevent parallel ...

Alon Bar-Lev alonbl at redhat.com
Tue May 21 18:47:58 UTC 2013


Alon Bar-Lev has posted comments on this change.

Change subject: ovirt-node-upgrade: add lock file check to prevent parallel runs
......................................................................


Patch Set 1: (1 inline comment)

....................................................
File scripts/ovirt-node-upgrade.py
Line 68:     locks = []
Line 69:     for f in os.listdir("/tmp"):
Line 70:         if f.startswith('.ovirtupgrade'):
Line 71:             locks.append(f)
Line 72:     if len(locks) > 0:
There is this[1] one.

What I recommend is to put pid in lock file, have constant name for the lock... and if exist, read content and try kill 0 it... if it is running then exit.

[1] https://pypi.python.org/pypi/lockfile
Line 73:         raise RuntimeError("Existing Lockfile Detected: %s" % locks)
Line 74: 
Line 75: class Base(object):
Line 76:     def __init__(self):


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifdd6553046d99cf9c9db29c1c899dc93e8ad733a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Joey Boggs <jboggs at redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alonbl at redhat.com>



More information about the node-patches mailing list