diff options
author | Tim Laszlo <tim.laszlo@gmail.com> | 2012-10-11 14:31:59 -0500 |
---|---|---|
committer | Tim Laszlo <tim.laszlo@gmail.com> | 2012-10-11 14:32:32 -0500 |
commit | aa77983b6384f0f4ec84e4918a9d10b1df99b4e7 (patch) | |
tree | 39f93c1eb3ab9f8f9289e1bd24c8be6c888e255c /src/lib | |
parent | 0b9a295dadcba6a79f5450db20fdf4b3cce27715 (diff) | |
download | bcfg2-aa77983b6384f0f4ec84e4918a9d10b1df99b4e7.tar.gz bcfg2-aa77983b6384f0f4ec84e4918a9d10b1df99b4e7.tar.bz2 bcfg2-aa77983b6384f0f4ec84e4918a9d10b1df99b4e7.zip |
Reports.Admin: Update prune for new schema
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Bcfg2/Server/Admin/Reports.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/Bcfg2/Server/Admin/Reports.py b/src/lib/Bcfg2/Server/Admin/Reports.py index e4125c2f8..1ff250bdf 100644 --- a/src/lib/Bcfg2/Server/Admin/Reports.py +++ b/src/lib/Bcfg2/Server/Admin/Reports.py @@ -41,7 +41,7 @@ def printStats(fn): def print_stats(self, *data): classes = (Client, Interaction, Performance, \ FailureEntry, ActionEntry, PathEntry, PackageEntry, \ - ServiceEntry) + ServiceEntry, Group, Bundle) starts = {} for cls in classes: @@ -227,11 +227,12 @@ class Reports(Bcfg2.Server.Admin.Mode): del a, b, c self.log.error(msg) - # bulk operations bypass the Interaction.delete method - self.log.debug("Pruning orphan Performance objects") - Performance.prune_orphans() - self.log.debug("Pruning orphan Reason objects") - Reason.prune_orphans() + # Prune any orphaned ManyToMany relations + for m2m in (ActionEntry, PackageEntry, PathEntry, ServiceEntry, \ + FailureEntry, Group, Bundle): + self.log.debug("Pruning any orphaned %s objects" % \ + m2m().__class__.__name__) + m2m.prune_orphans() if client and not filtered: '''Delete the client, ping data is automatic''' |