diff options
-rw-r--r-- | CHANGELOG | 2 | ||||
-rw-r--r-- | cobbler/remote.py | 39 |
2 files changed, 22 insertions, 19 deletions
@@ -10,6 +10,8 @@ Cobbler CHANGELOG - make cobblerd close file handles - fix kickstart serving when the tree is on NFS - fix missing reposync createdir (also now in stable branch) +- add back missing remove_profile/remove_repo +- remove profile_change support - Mon Jun 09 2008 - 1.0.2 - Fix mkdir invocation diff --git a/cobbler/remote.py b/cobbler/remote.py index 3d1a6a8..38912fc 100644 --- a/cobbler/remote.py +++ b/cobbler/remote.py @@ -198,25 +198,6 @@ class CobblerXMLRPCInterface: self.log("get_settings",token=token) return self.__get_all("settings") - def profile_change(self,mac,newprofile,token=None): - """ - If allow_cgi_profile_change is enabled in settings, this allows - kickstarts to set the profile of a machine to another profile - via a wget in %post. This has security implications. - READ: https://fedorahosted.org/cobbler/wiki/AutoProfileChange - """ - - if not self.api.settings().allow_cgi_profile_change: - return 1 - - system = self.api.find_system(mac_address=mac) - if system is None: - return 2 - - system.set_profile(newprofile) - self.api.add_system(system) - - def register_mac(self,mac,profile,token=None): """ If allow_cgi_register_mac is enabled in settings, this allows @@ -1037,6 +1018,26 @@ class CobblerReadWriteXMLRPCInterface(CobblerXMLRPCInterface): files[x.kickstart] = 1 return files.keys() + def remove_system(self,name,token,recursive=1): + """ + Deletes a system from a collection. Note that this just requires the name + of the distro, not a handle. + """ + self.log("remove_system (%s)" % recursive,name=name,token=token) + self.check_access(token, "remove_system", name) + rc = self.api._config.systems().remove(name,recursive=True) + return rc + + def remove_repo(self,name,token,recursive=1): + """ + Deletes a repo from a collection. Note that this just requires the name + of the repo, not a handle. + """ + self.log("remove_repo (%s)" % recursive,name=name,token=token) + self.check_access(token, "remove_repo", name) + rc = self.api._config.repos().remove(name,recursive=True) + return rc + def read_or_write_kickstart_template(self,kickstart_file,is_read,new_data,token): """ |