summaryrefslogtreecommitdiffstats
path: root/cobbler/distros.py
diff options
context:
space:
mode:
Diffstat (limited to 'cobbler/distros.py')
-rw-r--r--cobbler/distros.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/cobbler/distros.py b/cobbler/distros.py
new file mode 100644
index 0000000..a6b4b14
--- /dev/null
+++ b/cobbler/distros.py
@@ -0,0 +1,26 @@
+import distro
+import runtime
+import profiles
+
+"""
+A distro represents a network bootable matched set of kernels
+and initrd files
+"""
+class Distros(Collection):
+ _item_factory = distro.Distro
+
+ def remove(self,name):
+ """
+ Remove element named 'name' from the collection
+ """
+ # first see if any Groups use this distro
+ for k,v in profile.profiles().listing.items():
+ if v.distro == name:
+ runtime.set_error("orphan_files")
+ return False
+ if self.find(name):
+ del self.listing[name]
+ return True
+ runtime.set_error("delete_nothing")
+ return False
+