Project

Profile

Help

Refactor #847

closed

Refactor #765: Convert Pulp to use MongoEngine

Create a MongoEngine base class for Content Unit Models (ContentUnit)

Added by bcourt over 9 years ago. Updated over 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
2.7.0
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Pulp 2
Sprint:
April 2015
Quarter:

Description

Create a base class for all future Content Units that stores information in MongoEngine

  • The "AddUnitMixin.link_unit" functionality is currently only used when errata are created and is never read. This functionality does not need to be migrated to the unit model
  • user_metadata field
  • add a method add_content(source_location, relative_path)

source_location - the temp directory or location on disk where the plugin has stored the file or directory
relative_path - the relative path within /var/lib/pulp/content/content_type/<relative_path> where the content should be saved
when the unit is saved, if content has been added it will be moved into place in the content directory by the platform and the storage_path will be set the relative_path, use the post_save signal on the model

  • add a property for the absolute storage path, this is a combination of pulp_config.config.get('server', 'storage_dir')/unit.content_type/unit.storage_path
  • class method to set the _last_updated property and a signal hook on save to set or update the value
  • The init should validate that the model implements a field for the content_type (this field should be persisted to the database)
  • The init should validate that the model implements a property named unit_key_fields that lists the fields that make up the unit key (This is not persisted to the database)
  • Method to get the list of repositories that contain the given unit. (This method will be a no/op until the Repository and the RepositoryContentUnit collection has been converted)

https://fedorahosted.org/pulp/wiki/ConvertingUnitsToMongoengine


Related issues

Blocks Pulp - Refactor #853: Create the pulp.unit_models entry pointCLOSED - CURRENTRELEASEbcourt

Actions
Blocks Pulp - Refactor #865: Create a SharedContentUnit that extends the ContentUnitCLOSED - CURRENTRELEASEjortel@redhat.com

Actions
Blocks Pulp - Refactor #870: Create a generic serializer for RepositoryContentUnit/ContentUnitCLOSED - WONTFIX

Actions

Also available in: Atom PDF