Issue #1879
closedIncorrect name when syncing puppet module from the filesystem
Description
### For creating local motd module ###
sudo mkdir /var/www/html/pub/puppet-modules
sudo chmod a+rw /var/www/html/pub/puppet-modules
git clone https://github.com/puppetlabs/puppetlabs-motd.git
cd puppetlabs-motd
sudo pulp-puppet-module-builder --output-dir /var/www/html/pub/puppet-modules .
Sync this into Pulp with:
pulp-admin puppet repo create --repo-id=motd --feed=file:///var/www/html/pub/puppet-modules
pulp-admin puppet repo sync run --repo-id motd
If you look at the name stored in the DB for that puppet module you'll see:
"name" : "puppetlabs-motd",
The module name is puppetlabs-motd in the metadata.json, but for 2 reasons the name is expected to be just 'motd'.
1. When this module is published with the puppet install distributor, the folder name will be 'puppet-motd' which causes puppet to error when it runs. It expects the folder to be the same name as the puppet class which is motd.
2. This is different from the name produced by this same module brought in via sync-from -puppet-forge or traditional upload.
I recommend having the sync from file:// also use split_filename() as the others[0][1] do today.
[0]: https://github.com/pulp/pulp_puppet/blob/c9598b39f21a366dd771b05f9c6e3831f33f78e2/pulp_puppet_plugins/pulp_puppet/plugins/importers/forge.py#L298
[1]: https://github.com/pulp/pulp_puppet/blob/c9598b39f21a366dd771b05f9c6e3831f33f78e2/pulp_puppet_plugins/pulp_puppet/plugins/importers/upload.py#L46
Incorrect name when syncing puppet module from the filesystem.
closes #1879 closes #1880
https://pulp.plan.io/issues/1879 https://pulp.plan.io/issues/1880