[Pkg-nagios-changes] [SCM] UNNAMED PROJECT branch, debian/master, updated. 810edbdd3feedbfe37f4a65bee50b57b2f60fa2a
Gerhard Lausser
gerhard.lausser at consol.de
Tue Feb 28 22:13:14 UTC 2012
The following commit has been merged in the debian/master branch:
commit a94093bfd90bb04dc67788273cc835350792bf3e
Author: Gerhard Lausser <gerhard.lausser at consol.de>
Date: Wed Jan 11 19:34:20 2012 +0100
ENH do not use the internal self.items when deleting an element from Items
diff --git a/shinken/objects/hostdependency.py b/shinken/objects/hostdependency.py
index bd85b2e..137609a 100644
--- a/shinken/objects/hostdependency.py
+++ b/shinken/objects/hostdependency.py
@@ -60,7 +60,7 @@ class Hostdependency(Item):
class Hostdependencies(Items):
def delete_hostsdep_by_id(self, ids):
for id in ids:
- del self.items[id]
+ del self[id]
# We create new hostdep if necessery (host groups and co)
diff --git a/shinken/objects/item.py b/shinken/objects/item.py
index 69643cd..1d63db9 100644
--- a/shinken/objects/item.py
+++ b/shinken/objects/item.py
@@ -731,7 +731,7 @@ class Items(object):
""" Remove useless templates (& properties) of our items ; otherwise we could get errors on config.is_correct() """
tpls = [ i for i in self if i.is_tpl() ]
for i in tpls:
- del self.items[i.id]
+ del self[i.id]
del self.templates
del self.templates_graph
@@ -794,7 +794,7 @@ class Items(object):
i = self.items[id]
type = i.__class__.my_type
safe_print('Warning: the', type, i.get_name(), 'is already defined.')
- del self.items[id] # bye bye
+ del self[id] # bye bye
# do not remove twins, we should look in it, but just void it
self.twins = []
#del self.twins #no more need
diff --git a/shinken/objects/service.py b/shinken/objects/service.py
index 0927ac0..e599776 100644
--- a/shinken/objects/service.py
+++ b/shinken/objects/service.py
@@ -1059,7 +1059,7 @@ class Services(Items):
# Delete services by ids
def delete_services_by_id(self, ids):
for id in ids:
- del self.items[id]
+ del self[id]
# Apply implicit inheritance for special properties:
diff --git a/shinken/objects/servicedependency.py b/shinken/objects/servicedependency.py
index 53d51ba..d768edb 100644
--- a/shinken/objects/servicedependency.py
+++ b/shinken/objects/servicedependency.py
@@ -63,7 +63,7 @@ class Servicedependency(Item):
class Servicedependencies(Items):
def delete_servicesdep_by_id(self, ids):
for id in ids:
- del self.items[id]
+ del self[id]
#Add a simple service dep from another (dep -> par)
--
UNNAMED PROJECT
More information about the Pkg-nagios-changes
mailing list