#8229 closed defect (fixed)
bugzilla2trac.py error on user conversion from Bugzilla < 2.16.7
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | 0.12 |
Component: | contrib | Version: | devel |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
In the bugzilla2trac.py script the variable "users" is defined in the block starting with "if BZ_VERSION ≥ 2167:". For older Bugzilla versions, the variable "users" is not defined. As a result, the "for user in users:" statement that follows the block fails.
As a workaround, I added "else: users = []" to the "if" statement. This produces an empty password file instead of an error. It is probably cleaner to put the entire user conversion code inside the Bugzilla version check, so the script will not report that the user's passwords have been converted when in fact they haven't.
By the way, perhaps 2.16.7 is a bit too strict: as a test I converted the users from a Bugzilla 2.16.4 database and the resulting htaccess file looks reasonable. I didn't try authenticating against the generated htaccess file, but the user names are all there and password hashes are present and unique.
I set the severity to "blocker" because the bug blocked our migration to Trac. Finding the workaround was very easy though, so we were only blocked for a couple of minutes, but someone who is not a (Python) programmer might get stuck. If "blocker" is not appropriate for a script from "contrib", please forgive my ignorance and set it to a different severity.
Attachments (1)
Change History (6)
comment:4 by , 15 years ago
Keywords: | needinfo added |
---|
by , 15 years ago
Attachment: | bugzilla2trac.diff added |
---|
comment:5 by , 15 years ago
As I noted in the original description, the changes in the patch prevent the script from crashing, but for Bugzilla versions before 2.16.4 the script will report that the users were converted while that is not actually the case.
comment:6 by , 15 years ago
Keywords: | needinfo removed |
---|---|
Milestone: | → 0.12.1 |
Yes, maybe outputting a warning before the users = ()
line would do.
Thanks for the patch!
comment:7 by , 15 years ago
Component: | ticket system → contrib |
---|---|
Milestone: | next-minor-0.12.x → 0.12 |
Resolution: | → fixed |
Severity: | blocker → minor |
Status: | new → closed |
Forgot to apply it, done now [9298].
comment:8 by , 15 years ago
Owner: | set to |
---|
Maarten, can you write a patch with the changes you did?