Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/126973

Change subject: /var/lock/scap is now configurable via lock_file
......................................................................

/var/lock/scap is now configurable via lock_file

If we ever want to create integration tests, we better have to maintain
the lock dir on something which is writable.  This introduce the
lock_file configuration parameter which would let one easily change it.

Change-Id: If9f6a9ce2229738a0750ee87ccfeefe86428c37d
---
M scap.cfg
M scap/main.py
2 files changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/scap 
refs/changes/73/126973/1

diff --git a/scap.cfg b/scap.cfg
index c750969..9742f33 100644
--- a/scap.cfg
+++ b/scap.cfg
@@ -21,6 +21,10 @@
 # Staging directory for MediaWiki code and configuration
 stage_dir: /a/common
 
+# File used to prevent concurrent runs of scap on the host
+# Default: /var/lock/scap
+lock_file: /var/lock/scap
+
 # Host of master rsync server for cluster
 # Note: default value is only useful in a development environment and should
 # be overridden.
diff --git a/scap/main.py b/scap/main.py
index bab9e7e..3476e7c 100644
--- a/scap/main.py
+++ b/scap/main.py
@@ -131,7 +131,8 @@
         assert 'SSH_AUTH_SOCK' in os.environ, \
             'scap requires SSH agent forwarding'
 
-        with utils.lock('/var/lock/scap'):
+        lock_file = self.config.get('lock_file', '/var/lock/scap')
+        with utils.lock(lock_file):
             self.announce('Started scap: %s', self.arguments.message)
 
             tasks.check_php_syntax(

-- 
To view, visit https://gerrit.wikimedia.org/r/126973
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If9f6a9ce2229738a0750ee87ccfeefe86428c37d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/scap
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to