Ticket #8229 (closed defect: fixed)
Opened 3 years ago
Last modified 2 years ago
bugzilla2trac.py error on user conversion from Bugzilla < 2.16.7
| Reported by: | maarten.ter.huurne@… | Owned by: | maarten.ter.huurne@… |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.12 |
| Component: | contrib | Version: | devel |
| Severity: | minor | Keywords: | |
| Cc: | |||
| Release Notes: | |||
| API 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
Change History
comment:4 Changed 3 years ago by cboos
- Keywords needinfo added
Changed 3 years ago by maarten.ter.huurne@…
- Attachment bugzilla2trac.diff added
comment:5 Changed 3 years ago by maarten.ter.huurne@…
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 Changed 3 years ago by cboos
- Keywords needinfo removed
- Milestone set to 0.12.1
Yes, maybe outputting a warning before the users = () line would do.
Thanks for the patch!
comment:7 Changed 2 years ago by cboos
- Component changed from ticket system to contrib
- Milestone changed from next-minor-0.12.x to 0.12
- Resolution set to fixed
- Severity changed from blocker to minor
- Status changed from new to closed
Forgot to apply it, done now [9298].
comment:8 Changed 2 years ago by cboos
- Owner set to maarten.ter.huurne@…



Maarten, can you write a patch with the changes you did?