Merge ~hammerstefan/jenkins-launchpad-plugin:fix-trigger-timeout into jenkins-launchpad-plugin:master

Proposed by Stefan Hammer
Status: Merged
Merged at revision: 3f0f64688c6418d98b7497ce206518de4caa952e
Proposed branch: ~hammerstefan/jenkins-launchpad-plugin:fix-trigger-timeout
Merge into: jenkins-launchpad-plugin:master
Diff against target: 25 lines (+3/-0)
2 files modified
jlp/commands/launchpadTrigger.py (+1/-0)
jlp/socketlock.py (+2/-0)
Reviewer Review Type Date Requested Status
Paride Legovini Approve
Review via email: mp+444396@code.launchpad.net

Commit message

fix(launchpadTrigger): lock-timeout type error

Description of the change

Tested via a local virtualenv install of the modified jenkins-launchpad-plugin package
```
$ pip install -e .
$ launchpadTrigger --lock-name=maint-ci-cloudware-image_naming-trigger --job=maint-ci-cloudware-image_naming-test '--branch=lp:~cloudware/cloudware/+git/image_naming' --trigger-ci --repo_type=git --lock-timeout=60
DEBUG: Going to acquire launchpad lock "launchpad-trigger-lock-maint-ci-cloudware-image_naming-trigger" for launchpadTrigger
DEBUG: Lock acquired for launchpadTrigger
...
<CTRL-C>
```

To post a comment you must log in.
Revision history for this message
Paride Legovini (paride) wrote :

I'm off until 2023-06-13 inclusive, then I'll have a look at this unless anybody else chimes in before.

Revision history for this message
Paride Legovini (paride) wrote :

LGTM, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/jlp/commands/launchpadTrigger.py b/jlp/commands/launchpadTrigger.py
2index 0bc4dd3..a2cf238 100644
3--- a/jlp/commands/launchpadTrigger.py
4+++ b/jlp/commands/launchpadTrigger.py
5@@ -79,6 +79,7 @@ def launchpadTrigger():
6 to be used''')
7 parser.add_argument('--lock-timeout',
8 default=None,
9+ type=int,
10 help='''timeout in seconds (or None)''')
11 parser.add_argument("-r", "--repo_type", default="auto",
12 help="Repository type [bazaar, git, or auto]")
13diff --git a/jlp/socketlock.py b/jlp/socketlock.py
14index 97741cf..f4639b7 100644
15--- a/jlp/socketlock.py
16+++ b/jlp/socketlock.py
17@@ -34,6 +34,8 @@ class SocketLock(object):
18 """
19 if not timeout:
20 timeout = self.timeout
21+ if isinstance(timeout, str):
22+ timeout = int(timeout)
23
24 end_time = time.time()
25 if timeout is not None and timeout > 0:

Subscribers

People subscribed via source and target branches

to all changes: