diff options
author | Jason Kincl <kincljc@ornl.gov> | 2013-06-14 14:02:48 -0400 |
---|---|---|
committer | Jason Kincl <kincljc@ornl.gov> | 2013-06-17 10:14:56 -0400 |
commit | 9b7317bb94dec3235207598f85f34b1c01cae4f4 (patch) | |
tree | 82d66dd2bc0b02188f4700b58dccaeb9cdca5722 /src/lib/Bcfg2/Server | |
parent | 06b398542a5bf4a073f407a0fe96b5fed8d8a90a (diff) | |
download | bcfg2-9b7317bb94dec3235207598f85f34b1c01cae4f4.tar.gz bcfg2-9b7317bb94dec3235207598f85f34b1c01cae4f4.tar.bz2 bcfg2-9b7317bb94dec3235207598f85f34b1c01cae4f4.zip |
Probes: Fixing Django exception import
Diffstat (limited to 'src/lib/Bcfg2/Server')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Probes.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Probes.py b/src/lib/Bcfg2/Server/Plugins/Probes.py index 8937e4740..0974184b4 100644 --- a/src/lib/Bcfg2/Server/Plugins/Probes.py +++ b/src/lib/Bcfg2/Server/Plugins/Probes.py @@ -12,6 +12,7 @@ import Bcfg2.Server.Plugin try: from django.db import models + from django.core.exceptions import MultipleObjectsReturned HAS_DJANGO = True class ProbesDataModel(models.Model, @@ -255,7 +256,7 @@ class Probes(Bcfg2.Server.Plugin.Probing, ProbesGroupsModel.objects.get_or_create( hostname=client.hostname, group=group) - except ProbesGroupsModel.MultipleObjectsReturned: + except MultipleObjectsReturned: ProbesGroupsModel.objects.filter(hostname=client.hostname, group=group).delete() ProbesGroupsModel.objects.get_or_create( |