summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Reports
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-11-12 15:47:19 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-11-12 15:47:19 -0500
commit05929147dde2239ee0078359bd62b1ea5a884d86 (patch)
treebeba880dfd02b64c61a58ae196cfdc2cbe4dfa46 /src/lib/Bcfg2/Server/Reports
parent2b6824857c4ab80e3e791edf82aee3e75e037316 (diff)
parent30882ba70ad627f89ab89af6ffc77cda08de8773 (diff)
downloadbcfg2-05929147dde2239ee0078359bd62b1ea5a884d86.tar.gz
bcfg2-05929147dde2239ee0078359bd62b1ea5a884d86.tar.bz2
bcfg2-05929147dde2239ee0078359bd62b1ea5a884d86.zip
Merge branch 'maint'
Conflicts: src/lib/Bcfg2/Server/Admin/Reports.py src/lib/Bcfg2/Server/Hostbase/hostbase/urls.py src/lib/Bcfg2/Server/Hostbase/urls.py src/sbin/bcfg2-crypt tools/upgrade/1.3/migrate_dbstats.py
Diffstat (limited to 'src/lib/Bcfg2/Server/Reports')
-rw-r--r--src/lib/Bcfg2/Server/Reports/reports/models.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Server/Reports/reports/models.py b/src/lib/Bcfg2/Server/Reports/reports/models.py
index c7105fdd9..ac4c8eac4 100644
--- a/src/lib/Bcfg2/Server/Reports/reports/models.py
+++ b/src/lib/Bcfg2/Server/Reports/reports/models.py
@@ -9,11 +9,13 @@ except ImproperlyConfigured:
print("Reports: unable to import django models: %s" % e)
sys.exit(1)
-from django.db import connection, transaction
+from django.db import connection
from django.db.models import Q
from datetime import datetime, timedelta
from time import strptime
+from Bcfg2.Reporting.Compat import transaction
+
KIND_CHOICES = (
#These are the kinds of config elements
('Package', 'Package'),
@@ -294,7 +296,7 @@ class Reason(models.Model):
return rv
@staticmethod
- @transaction.commit_on_success
+ @transaction.atomic
def prune_orphans():
'''Prune oprhaned rows... no good way to use the ORM'''
cursor = connection.cursor()
@@ -311,7 +313,7 @@ class Entries(models.Model):
return self.name
@staticmethod
- @transaction.commit_on_success
+ @transaction.atomic
def prune_orphans():
'''Prune oprhaned rows... no good way to use the ORM'''
cursor = connection.cursor()
@@ -340,7 +342,7 @@ class Performance(models.Model):
return self.metric
@staticmethod
- @transaction.commit_on_success
+ @transaction.atomic
def prune_orphans():
'''Prune oprhaned rows... no good way to use the ORM'''
cursor = connection.cursor()