summaryrefslogtreecommitdiffstats
path: root/cobbler/collection.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-11-06 15:59:26 -0500
committerMichael DeHaan <mdehaan@redhat.com>2008-11-06 15:59:26 -0500
commitee1171bf4abedc811d40073c86ec202c99b0973e (patch)
tree848dea414c70ac8dd88e6697b62ecc6ced91485e /cobbler/collection.py
parentef60e69783ecac9a9ae3a8f1d979fff3f1ed56d9 (diff)
downloadcobbler-ee1171bf4abedc811d40073c86ec202c99b0973e.tar.gz
cobbler-ee1171bf4abedc811d40073c86ec202c99b0973e.tar.xz
cobbler-ee1171bf4abedc811d40073c86ec202c99b0973e.zip
Fairly extensive overhaul of the test code, and correcting some API-based gotchas found as a result of testing. First, test_basic.py code now uses api.py methods as opposed to lower level methods, ensuring we test what API consumers are most likely to use. Second, remote.py tests are (largely) complete and clean. In api.py and remote.py I've added a method to ensure that the API configurations are always up to date before API calls, preventing synchronization issues that previously had to be worked around. As a result of this the server.update() call is no more. The mechanism behind this remains rough and we may want to optimize things a bit later, though the API signatures around this new checking code are solid. Upgrading the internals should be possible to avoid additional reloading of the config. Ultimately we may want to teach cobbler's local API to ask cobbler's cobblerd for it's definitive copy though that is to be explored later.
Diffstat (limited to 'cobbler/collection.py')
-rw-r--r--cobbler/collection.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/cobbler/collection.py b/cobbler/collection.py
index 3df7234c..7f3a3aac 100644
--- a/cobbler/collection.py
+++ b/cobbler/collection.py
@@ -144,6 +144,9 @@ class Collection(serializable.Serializable):
item = self.factory_produce(self.config,seed_data)
self.add(item)
+ def copy(self,ref,newname):
+ ref.name = newname
+ 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):
"""