Project

Profile

Help

Story #3182

Updated by bmbouter almost 7 years ago

A plugin interface needs to be added to Specifically the plugin API that plugin writers can all to get the full path to a persistent, shared storage location. 

 A new storage.py should be made in the pulp repo at <code>/plugin/pulpcore/plugin/storage.py</code>. It should provide an interface called <code>get_plugin_storage_path()</code> that returns a string like <code>/var/lib/pulp/shared/<the_plugin_name></code>. So would be: <code>/var/lib/pulp/shared/<plugin_name>/</code>. For example for pulp_ansible, the ansible Plugin, which is formally called pulp_ansible, that string path would be <code>/var/lib/pulp/shared/pulp_ansible/</code> when called from inside the pulp_ansible code. <code>/var/lib/pulp/shared/pulp_ansible/</code>. 

 We are using an interface so need plugin writer docs documenting that in the future users could possibly configure this. For now all returned strings will start with <code>/var/lib/pulp/shared/</code>. Also the full this path returned must include a trailing slash since it's meant to be appended to. is for them. 

 The motivating use case is that some plugins like pulp_ostree and pulp_ansible need to use other tools, like python-ostree and python-git to sync data from the remotes. Those tools expect to be writing data to a place they manage. We could have them write to the temp dir, but then we have to have them add all of that indexed content to Pulp which removes some of the benefit those tools provide. Having them write to a dedicated area of the filesystem directly instead is the current plan.

Back