summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2013-11-11 21:36:50 +0100
committerSol Jerome <sol.jerome@gmail.com>2013-11-11 22:19:56 -0600
commitb7479fa7dc6d87135fb328dbf9ba4bcd81a5db53 (patch)
treece1dc6702ad457b06a818baf08d916bdc9190de3 /tools
parent103b1b5198828876fa0684296900769018075f1b (diff)
downloadbcfg2-b7479fa7dc6d87135fb328dbf9ba4bcd81a5db53.tar.gz
bcfg2-b7479fa7dc6d87135fb328dbf9ba4bcd81a5db53.tar.bz2
bcfg2-b7479fa7dc6d87135fb328dbf9ba4bcd81a5db53.zip
Fix compatibility with Django 1.6.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/upgrade/1.3/migrate_dbstats.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/upgrade/1.3/migrate_dbstats.py b/tools/upgrade/1.3/migrate_dbstats.py
index 07def2ac8..34430e3df 100755
--- a/tools/upgrade/1.3/migrate_dbstats.py
+++ b/tools/upgrade/1.3/migrate_dbstats.py
@@ -10,11 +10,12 @@ import time
import Bcfg2.Logger
import Bcfg2.Options
from django.core.cache import cache
-from django.db import connection, transaction, backend
+from django.db import connection, backend
from Bcfg2.Server.Admin.Reports import Reports
from Bcfg2.Reporting import models as new_models
from Bcfg2.Reporting.utils import BatchFetch
+from Bcfg2.Reporting.Compat import transaction
from Bcfg2.Server.Reports.reports import models as legacy_models
logger = logging.getLogger(__name__)
@@ -38,7 +39,7 @@ def _quote(value):
return _our_backend.quote_name(value)
-@transaction.commit_on_success
+@transaction.atomic
def _migrate_perms():
"""helper"""
@@ -57,7 +58,7 @@ def _migrate_perms():
return fperms
-@transaction.commit_on_success
+@transaction.atomic
def _migrate_transaction(inter, entries, fperms):
"""helper"""
@@ -187,7 +188,7 @@ def _shove(old_table, new_table, columns):
cursor.close()
-@transaction.commit_on_success
+@transaction.atomic
def migrate_stage1():
logger.info("Migrating clients")
try: