summaryrefslogtreecommitdiffstats
path: root/cobbler/collection.py
diff options
context:
space:
mode:
Diffstat (limited to 'cobbler/collection.py')
-rw-r--r--cobbler/collection.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cobbler/collection.py b/cobbler/collection.py
index c113481..98e841c 100644
--- a/cobbler/collection.py
+++ b/cobbler/collection.py
@@ -154,6 +154,10 @@ class Collection(serializable.Serializable):
"""
if ref is None or not ref.is_valid():
raise CX(_("insufficient or invalid arguments supplied"))
+
+ if ref.COLLECTION_TYPE != self.collection_type():
+ raise CX(_("API error: storing wrong data type in collection"))
+
if not with_copy:
# don't need to run triggers, so add it already ...
self.listing[ref.name.lower()] = ref