jenkins-bot has submitted this change and it was merged.
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/config.py
M scap/main.py
3 files changed, 5 insertions(+), 1 deletion(-)
Approvals:
BryanDavis: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scap.cfg b/scap.cfg
index c750969..264767c 100644
--- a/scap.cfg
+++ b/scap.cfg
@@ -21,6 +21,9 @@
# Staging directory for MediaWiki code and configuration
stage_dir: /a/common
+# File used to prevent concurrent runs of scap on the host
+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/config.py b/scap/config.py
index eb46129..76fb342 100644
--- a/scap/config.py
+++ b/scap/config.py
@@ -13,6 +13,7 @@
DEFAULT_CONFIG = {
'deploy_dir': '/usr/local/apache/common-local',
'stage_dir': '/a/common',
+ 'lock_file': '/var/lock/scap',
'master_rsync': 'localhost',
'statsd_host': '127.0.0.1',
'statsd_port': 2003,
diff --git a/scap/main.py b/scap/main.py
index bab9e7e..56245d1 100644
--- a/scap/main.py
+++ b/scap/main.py
@@ -131,7 +131,7 @@
assert 'SSH_AUTH_SOCK' in os.environ, \
'scap requires SSH agent forwarding'
- with utils.lock('/var/lock/scap'):
+ with utils.lock(self.config['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: merged
Gerrit-Change-Id: If9f6a9ce2229738a0750ee87ccfeefe86428c37d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/tools/scap
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits