jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/347525 )
Change subject: Rename confusing use of "job tag"
......................................................................
Rename confusing use of "job tag"
Change-Id: I961bc4dc331837d974465a18f570b088fa629952
---
M processcontrol/lock.py
M processcontrol/runner.py
M tests/test_lock.py
3 files changed, 13 insertions(+), 13 deletions(-)
Approvals:
jenkins-bot: Verified
Ejegg: Looks good to me, approved
diff --git a/processcontrol/lock.py b/processcontrol/lock.py
index 38e6c67..f913139 100644
--- a/processcontrol/lock.py
+++ b/processcontrol/lock.py
@@ -18,8 +18,8 @@
# TODO: Decide whether we want to failopen?
-def begin(failopen=False, job_tag=None):
- filename = path_for_job(job_tag)
+def begin(failopen=False, slug=None):
+ filename = path_for_job(slug)
if os.path.exists(filename):
config.log.error("Lockfile found!")
diff --git a/processcontrol/runner.py b/processcontrol/runner.py
index 0c39dab..9e20d4f 100644
--- a/processcontrol/runner.py
+++ b/processcontrol/runner.py
@@ -31,7 +31,7 @@
passwd_entry = pwd.getpwnam(service_user)
assert passwd_entry.pw_uid == os.getuid()
- lock.begin(job_tag=self.job.slug)
+ lock.begin(slug=self.job.slug)
self.start_time = datetime.datetime.utcnow()
job_history = job_state.load_state(self.job.slug)
job_history.record_started(self.start_time)
diff --git a/tests/test_lock.py b/tests/test_lock.py
index eb56e95..c6073c5 100644
--- a/tests/test_lock.py
+++ b/tests/test_lock.py
@@ -18,7 +18,7 @@
def test_success():
tag = "success"
- lock.begin(job_tag=tag)
+ lock.begin(slug=tag)
assert lock.lockfile
path = lock.lockfile
assert os.path.exists(lock.lockfile)
@@ -30,15 +30,15 @@
@nose.tools.raises(lock.LockError)
def test_live_lock():
tag = "live"
- lock.begin(job_tag=tag)
+ lock.begin(slug=tag)
# Will die because the process (this one) is still running.
- lock.begin(job_tag=tag)
+ lock.begin(slug=tag)
def test_stale_lock():
tag = "stale"
- lock.begin(job_tag=tag)
+ lock.begin(slug=tag)
# Make the lockfile stale by changing the process ID.
assert lock.lockfile
@@ -46,7 +46,7 @@
f.write("-1")
f.close()
- lock.begin(job_tag=tag)
+ lock.begin(slug=tag)
# Check that we overwrote the contents with the current PID.
assert lock.lockfile
@@ -61,7 +61,7 @@
@nose.tools.raises(lock.LockError)
def test_stale_lock_failopen():
tag = "stale-open"
- lock.begin(job_tag=tag)
+ lock.begin(slug=tag)
# Make the lockfile stale by changing the process ID.
assert lock.lockfile
@@ -69,12 +69,12 @@
f.write("-1")
f.close()
- lock.begin(job_tag=tag, failopen=True)
+ lock.begin(slug=tag, failopen=True)
def test_invalid_lock():
tag = "stale"
- lock.begin(job_tag=tag)
+ lock.begin(slug=tag)
# Make the lockfile invalid by changing the process ID to non-numeric.
assert lock.lockfile
@@ -82,7 +82,7 @@
f.write("ABC")
f.close()
- lock.begin(job_tag=tag)
+ lock.begin(slug=tag)
# Check that we overwrote the contents with the current PID.
assert lock.lockfile
@@ -97,7 +97,7 @@
@nose.tools.raises(lock.LockError)
def test_double_unlock():
tag = "unlock-unlock"
- lock.begin(job_tag=tag)
+ lock.begin(slug=tag)
lock.end()
# Should throw an exception.
--
To view, visit https://gerrit.wikimedia.org/r/347525
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I961bc4dc331837d974465a18f570b088fa629952
Gerrit-PatchSet: 5
Gerrit-Project: wikimedia/fundraising/process-control
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
Gerrit-Reviewer: Cdentinger <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits