Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

#1592 closed defect (fixed)

Upgrade script to db version 11 fails on "macros_dir"

Reported by: arnarb@… Owned by: Christopher Lenz
Priority: normal Milestone: 0.9
Component: admin/console Version: devel
Severity: major Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When upgrading directly from db version 8 to 13, the upgrade fails on source:trunk/trac/upgrades/db11.py#1723 with the following error:

Upgrade failed: 'module' object has no attribute '__default_macros_dir_dir__'

This is because default_dir is called with the string "macros_dir" instead of just "macros" (default_dir adds "_dir").

After fixing this, another error emerges:

Upgrade failed: global name 'macros_dir' is not defined

The whole patch for fixing both errors follows

Index: db11.py
===================================================================
--- db11.py     (revision 1725)
+++ db11.py     (working copy)
@@ -33,10 +33,10 @@
 
     # Copy the new default wiki macros over to the environment
     from trac.config import default_dir
-    for f in os.listdir(default_dir('macros_dir')):
+    for f in os.listdir(default_dir('macros')):
         if not f.endswith('.py'):
             continue
-        src = os.path.join(macros_dir, f)
+        src = os.path.join(default_dir('macros'), f)
         dst = os.path.join(env.path, 'wiki-macros', f)
         if not os.path.isfile(dst):
             shutil.copy2(src, dst)

Attachments (0)

Change History (2)

comment:1 by Christopher Lenz, 19 years ago

Milestone: 0.9
Owner: changed from daniel to Christopher Lenz
Status: newassigned

Oops, mea culpa. Thanks for reporting this.

comment:2 by Christopher Lenz, 19 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [1726].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.