The watcher.db.purge Module

class watcher.db.purge.PurgeCommand(age_in_days=None, max_number=None, uuid=None, exclude_orphans=False, dry_run=None)[source]

Bases: object

Purges the DB by removing soft deleted entries

The workflow for this purge is the following:

# Find soft deleted objects which are expired # Find orphan objects # Find their related objects whether they are expired or not # Merge them together # If it does not exceed the limit, destroy them all

confirmation_prompt()[source]
delete_up_to_max_prompt(objects_map)[source]
do_delete()[source]
execute()[source]
find_objects_to_delete()[source]

Finds all the objects to be purged

Returns:A mapping with all the Watcher objects to purged
Return type:WatcherObjectsMap instance
get_expiry_date()[source]
classmethod get_goal_uuid(uuid_or_name)[source]
class watcher.db.purge.WatcherObjectsMap[source]

Bases: object

Wrapper to deal with watcher objects per type

This wrapper object contains a list of watcher objects per type. Its main use is to simplify the merge of watcher objects by avoiding duplicates, but also for representing the relationships between these objects.

get_count_table()[source]
classmethod keys()[source]
values()[source]