summaryrefslogtreecommitdiffstats
path: root/cobbler/collection.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-11-24 18:26:36 -0500
committerMichael DeHaan <mdehaan@redhat.com>2008-11-24 18:26:36 -0500
commitf1e10e6c3c1cb3201f1a8f2636c91e46383a89b1 (patch)
tree3ce9fe3e2193b0d90ddf9fc3f503b367691d81ac /cobbler/collection.py
parent1f2317512043fb84cdbdbef89d9964558dfdf39d (diff)
downloadcobbler-f1e10e6c3c1cb3201f1a8f2636c91e46383a89b1.tar.gz
cobbler-f1e10e6c3c1cb3201f1a8f2636c91e46383a89b1.tar.xz
cobbler-f1e10e6c3c1cb3201f1a8f2636c91e46383a89b1.zip
Add UID field to API
Diffstat (limited to 'cobbler/collection.py')
-rw-r--r--cobbler/collection.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cobbler/collection.py b/cobbler/collection.py
index 224b6863..36f74812 100644
--- a/cobbler/collection.py
+++ b/cobbler/collection.py
@@ -27,6 +27,7 @@ import utils
import glob
import time
import sub_process
+import random
import action_litesync
import item_system
@@ -48,7 +49,6 @@ class Collection(serializable.Serializable):
self.log_func = self.api.log
self.lite_sync = None
-
def factory_produce(self,config,seed_data):
"""
Must override in subclass. Factory_produce returns an Item object
@@ -147,6 +147,7 @@ class Collection(serializable.Serializable):
def copy(self,ref,newname):
ref.name = newname
+ ref.uid = self.config.generate_uid()
return self.add(ref,save=True,with_copy=True,with_triggers=True,with_sync=True,check_for_duplicate_names=True,check_for_duplicate_netinfo=False)
def rename(self,ref,newname,with_sync=True,with_triggers=True):
@@ -159,6 +160,7 @@ class Collection(serializable.Serializable):
oldname = ref.name
newref = ref.make_clone()
newref.set_name(newname)
+
self.add(newref, with_triggers=with_triggers,save=True)
# now descend to any direct ancestors and point them at the new object allowing
@@ -205,7 +207,7 @@ class Collection(serializable.Serializable):
So, in that case, don't run any triggers and don't deal with any actual files.
"""
-
+
if save is True:
now = time.time()
if ref.ctime == 0: