[kteam-tools][PATCH] link-to-tracker: add a --re-run commandline option

Juerg Haefliger juerg.haefliger at canonical.com
Thu Oct 12 14:59:13 UTC 2017

Sometimes it's desirable or necessary to re-run link-to-tracker. Currently
the script bails out if the title of the tracking bug doesn't contain
the string '<version to be filled>' which means the script ran already.
This new commandline option will bypass that check.

Signed-off-by: Juerg Haefliger <juerg.haefliger at canonical.com>
 stable/link-to-tracker | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/stable/link-to-tracker b/stable/link-to-tracker
index 9f4796753bd2..bb31d97391a8 100755
--- a/stable/link-to-tracker
+++ b/stable/link-to-tracker
@@ -179,7 +179,7 @@ class Tracking():
             found = []
             for (bugid, tasks_by_name) in found_tasks:
                 lpbug = s.launchpad.bugs[bugid]
-                if '<version to be filled>' not in lpbug.title:
+                if not s.args.re_run and '<version to be filled>' not in lpbug.title:
                 if s.args.sru_cycle and s.bug_to_sru_cycle(lpbug) != s.args.sru_cycle:
@@ -260,6 +260,7 @@ if __name__ == '__main__':
     parser.add_argument('--info',  action='store_true', default=False, help='')
     parser.add_argument('--debug', action='store_true', default=False, help='')
     parser.add_argument('--dry-run', action='store_true', default=False, help='')
+    parser.add_argument('--re-run', action='store_true', default=False, help='')
     parser.add_argument('--sru-cycle', action='store', help='')
     args = parser.parse_args()

More information about the kernel-team mailing list