Hi,

we just ported our project from bugzilla to trac and we had some problems 
with the migration script. One of them is related to a local variable which 
is not set and shall be returned in the *addTicket()* method.

7. Import bugs and bug activity...
>
  inserting ticket 1 -- Test Bug  
>
Traceback (most recent call last):
>
  File "bugzilla2trac.py", line 976, in <module>
>
    main()                                      
>
  File "bugzilla2trac.py", line 973, in main    
>
    convert(BZ_DB, BZ_HOST, BZ_USER, BZ_PASSWORD, TRAC_ENV, TRAC_CLEAN)
>
  File "bugzilla2trac.py", line 872, in convert                        
>
    ticketid = trac.addTicket(**ticket)                                
>
  File "bugzilla2trac.py", line 367, in addTicket                      
>
    return ticket_id                                                   
>
UnboundLocalError: local variable 'ticket_id' referenced before assignment
>

The variable *ticketid* in the *convert()* method is not used anyway, but 
as far as I understood the code the *ticket_id* variable in *addTicket()*method 
should be initialized in the beginning to 
*id*:

...
314:    def addTicket(self, id, time, changetime, component, severity, 
priority,
315:                  owner, reporter, cc, version, milestone, status, 
resolution,
316:                  summary, description, keywords, customfields):
317:
318:        ticket_id = id
319:        desc = description
320:        type = "defect"
...

We used Bugzilla 3.0.4 and with this change the script executed 
successfully!

Greets

Jan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to