OPSI.Util.Task.CleanupBackend module

opsi python library - Util - Task - Backend Cleanup

Functionality to clean up an OPSI Backend.

The aim of this module is to remove obsolete data from the backend to ensure having clean data.

The everyday method for this job is cleanupBackend(). For more specialised cleanup you should use the corresponding methods.

New in version 4.0.4.2.

author:Niko Wenselowski <n.wenselowski@uib.de>
license:GNU Affero General Public License version 3
OPSI.Util.Task.CleanupBackend.cleanUpAuditSoftwareOnClients(backend)

Deletes unreferenced auditSoftwareOnClients.

Parameters:backend (OPSI.Backend.Backend) – The backend where the data should be cleaned.
OPSI.Util.Task.CleanupBackend.cleanUpAuditSoftwares(backend)

Deletes unreferenced audit software.

Parameters:backend (OPSI.Backend.Backend) – The backend where the data should be cleaned.
OPSI.Util.Task.CleanupBackend.cleanUpConfigStates(backend)

Deletes configStates if the corresponding config is nonexisting.

Parameters:backend (OPSI.Backend.Backend) – The backend where the data should be cleaned.
OPSI.Util.Task.CleanupBackend.cleanUpGroups(backend)

This checks if a group has a parent set that does not exist and removes non-existing parents.

Parameters:backend (OPSI.Backend.Backend) – The backend where the data should be cleaned.
OPSI.Util.Task.CleanupBackend.cleanUpMySQL(backendConfigFile=u'/etc/opsi/backends/mysql.conf')

Clean up an MySQL backend.

This does not work with any backend other than MySQL.

Parameters:backendConfigFile (str) – The configuration file of the currently used MySQL backend.
OPSI.Util.Task.CleanupBackend.cleanUpProductOnClients(backend)

Delete ProductOnClient if the client does not exist or is either not_installed without an action request set.

Parameters:backend (OPSI.Backend.Backend) – The backend where the data should be cleaned.
OPSI.Util.Task.CleanupBackend.cleanUpProductOnDepots(backend, depotIds, existingProductIdents)

Deletes obsolete information that occurs if either a depot or a product is not existing anymore.

Parameters:
  • backend (OPSI.Backend.Backend) – The backend where the data should be cleaned.
  • depotIds ([str, ]) – IDs of the existing depot.
  • existingProductIdents ([str, ]) – Idents of the existing products.
OPSI.Util.Task.CleanupBackend.cleanUpProducts(backend)

This will delete any unreferenced product from the backend.

Parameters:backend (OPSI.Backend.Backend) – The backend where the data should be cleaned.
OPSI.Util.Task.CleanupBackend.cleanupBackend(backend=None)

Clean up data from your backends.

This method uses different cleanup methods to ensure that no obsolete data is present in your backend.

Parameters:backend (OPSI.Backend.Backend) – the backend to check. If None this will create a BackendManager from default paths.