[PATCH 1/1] start-sru-cycle: New option 'usemasterbug'
Khalid Elmously
khalid.elmously at canonical.com
Thu Jul 12 04:59:51 UTC 2018
New option '--usemasterbug' to use pre-existing master bug instead of creating a new one.
Signed-off-by: Khalid Elmously <khalid.elmously at canonical.com>
---
ktl/tracking_bug.py | 4 ++++
stable/start-sru-cycle | 14 +++++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/ktl/tracking_bug.py b/ktl/tracking_bug.py
index 8956fa90..efea3678 100644
--- a/ktl/tracking_bug.py
+++ b/ktl/tracking_bug.py
@@ -357,6 +357,10 @@ class TrackingBug:
s.reset_tasks(bug)
return bug
+ def get_bug(self, bug_id):
+ bug = self.lp.get_bug(bug_id)
+ return bug
+
def open(self, package, version, new_abi, master_bug, series_specified, private=False):
center(self.__class__.__name__ + '.open')
cdebug(' package: %s' % package)
diff --git a/stable/start-sru-cycle b/stable/start-sru-cycle
index 60525c20..9ebb4562 100755
--- a/stable/start-sru-cycle
+++ b/stable/start-sru-cycle
@@ -129,8 +129,19 @@ class Crankers():
print(' ' + master_package)
print(' %s:%s' % (series, master_package))
- if not s.args.dryrun:
+
+ have_master_bug = False
+
+ if s.args.usemasterbug:
+ master_bug = s.tb.get_bug(s.args.usemasterbug[0])
+ print("Using pre-existing master-bug: %s" %(master_bug.id))
+ have_master_bug = True
+
+ elif not s.args.dryrun:
master_bug = s.tb.open(master_package, '<version to be filled>', True, None, series)
+ have_master_bug = True
+
+ if have_master_bug:
for task in master_bug.tasks:
# Move the primary package to Confirmed, link-to-tracker and
# shanky will keep on top of the others and move them as needed.
@@ -196,6 +207,7 @@ Examples:
parser.add_argument('--source', action='append', default=[], metavar='source', help='Only create tracking bugs for the specified source package(s). Requiers exactly one series argument to be given. This option can be used multiple times.')
parser.add_argument('--staging', action='store_true', default=False, help='Use the staging LP server to create the bug. This is just for testing and will go away when the staging database is reset.')
parser.add_argument('--dry-run', '--dryrun', action='store_true', default=False, help='Make no permanent changes.', dest='dryrun')
+ parser.add_argument('--usemasterbug', type=int, nargs=1, help='Use pre-existing master-bug instead of creating a new one')
args = parser.parse_args()
--
2.17.1
More information about the kernel-team
mailing list