Edgewall Software

Ticket #1592 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Upgrade script to db version 11 fails on "macros_dir"

Reported by: arnarb@… Owned by: cmlenz
Priority: normal Milestone: 0.9
Component: admin/console Version: devel
Severity: major Keywords:
Cc:

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

Change History

Changed 4 years ago by cmlenz

  • owner changed from daniel to cmlenz
  • status changed from new to assigned
  • milestone set to 0.9

Oops, mea culpa. Thanks for reporting this.

Changed 4 years ago by cmlenz

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in [1726].

Add/Change #1592 (Upgrade script to db version 11 fails on "macros_dir")

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from cmlenz. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.