From 484853e39216e15b0de5ca6fd7906b5f294e8e4d Mon Sep 17 00:00:00 2001 From: Tim Laszlo Date: Wed, 17 Oct 2012 11:48:46 -0500 Subject: Revert "migrate_db: skip db lookup since all should be known" This caused data duplication on migration. This reverts commit 9707ee8e4c495133f329000d3e5b89d8b84e5998. Conflicts: src/lib/Bcfg2/Reporting/models.py --- src/lib/Bcfg2/Reporting/models.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/Bcfg2/Reporting/models.py b/src/lib/Bcfg2/Reporting/models.py index 70a03c2db..b6549fc64 100644 --- a/src/lib/Bcfg2/Reporting/models.py +++ b/src/lib/Bcfg2/Reporting/models.py @@ -355,7 +355,7 @@ class BaseEntry(models.Model): @classmethod - def entry_get_or_create(cls, act_dict, skip_fetch=False): + def entry_get_or_create(cls, act_dict): """Helper to quickly lookup an object""" cls_name = cls().__class__.__name__ act_hash = hash_entry(act_dict) @@ -365,11 +365,8 @@ class BaseEntry(models.Model): newact = cache.get(act_key) if newact: return newact - - if not skip_fetch: - acts = cls.objects.filter(hash_key=act_hash) - else: - acts = [] + + acts = cls.objects.filter(hash_key=act_hash) if len(acts) > 0: for act in acts: for key in act_dict: -- cgit v1.2.3-1-g7c22