summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2007-10-15 15:20:08 -0400
committerMichael DeHaan <mdehaan@redhat.com>2007-10-15 15:20:08 -0400
commitaff41dac004906e84eabda7fe912a37201e44360 (patch)
treeb2b34c8fd056b38ad2542d48a5901a909f3cbfcb
parent181de7a2181704f57308aecacf25eb11dd77aa19 (diff)
downloadthird_party-cobbler-aff41dac004906e84eabda7fe912a37201e44360.tar.gz
third_party-cobbler-aff41dac004906e84eabda7fe912a37201e44360.tar.xz
third_party-cobbler-aff41dac004906e84eabda7fe912a37201e44360.zip
Fix deletion logic.
-rw-r--r--cobbler/modules/serializer_shelve.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cobbler/modules/serializer_shelve.py b/cobbler/modules/serializer_shelve.py
index 174bb0e..2b55d57 100644
--- a/cobbler/modules/serializer_shelve.py
+++ b/cobbler/modules/serializer_shelve.py
@@ -63,7 +63,8 @@ def serialize_item(obj, item):
# NOTE: not heavily tested
def serialize_item(obj, item):
fd = shelve.open(obj.filename() + ".shelve","w")
- del fd[item.name]
+ if fd.has_key(item.name):
+ del fd[item.name]
fd.sync()
return True