Skip to content

Commit bbf9451

Browse files
committed
bin: Deprecate the --bztype field
It's been hidden for a while, stop abiding it and just always autodetect
1 parent 7d93ba9 commit bbf9451

2 files changed

Lines changed: 11 additions & 17 deletions

File tree

bin/bugzilla

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,30 +1156,24 @@ def _do_set_attach(bz, opt, parser, args):
11561156
# Main handling #
11571157
#################
11581158

1159-
def _make_bz_instance(global_opt, parser):
1159+
def _make_bz_instance(global_opt):
11601160
"""
11611161
Build the Bugzilla instance we will use
11621162
"""
1163-
if global_opt.bztype == 'auto':
1164-
log.info('Autodetecting Bugzilla type')
1165-
bzclass = bugzilla.Bugzilla
1166-
elif global_opt.bztype in bugzilla.classlist:
1167-
log.info('Using Bugzilla class %s', global_opt.bztype)
1168-
bzclass = getattr(bugzilla, global_opt.bztype)
1169-
else:
1170-
parser.error("bztype must be one of: %s" % str(bugzilla.classlist))
1163+
if global_opt.bztype != 'auto':
1164+
log.info("Explicit --bztype is no longer supported, ignoring")
11711165

1166+
cookiefile = None
1167+
tokenfile = None
11721168
if global_opt.cache_credentials:
11731169
cookiefile = global_opt.cookiefile or -1
11741170
tokenfile = global_opt.tokenfile or -1
1175-
else:
1176-
cookiefile = None
1177-
tokenfile = None
11781171

1179-
bz = bzclass(url=global_opt.bugzilla,
1180-
cookiefile=cookiefile,
1181-
tokenfile=tokenfile,
1182-
sslverify=global_opt.sslverify)
1172+
bz = bugzilla.Bugzilla(
1173+
url=global_opt.bugzilla,
1174+
cookiefile=cookiefile,
1175+
tokenfile=tokenfile,
1176+
sslverify=global_opt.sslverify)
11831177
return bz
11841178

11851179

bugzilla/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def _init_class_from_url(self, url, sslverify):
116116

117117

118118
# This is the list of possible Bugzilla instances an app can use,
119-
# bin/bugzilla uses it for the --bztype field
119+
# bin/bugzilla used to use it for the --bztype field
120120
classlist = [
121121
"Bugzilla3", "Bugzilla32", "Bugzilla34", "Bugzilla36",
122122
"Bugzilla4", "Bugzilla42", "Bugzilla44",

0 commit comments

Comments
 (0)