Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a more detailed error message
Before this change, it was not possible to determine why did the synchronization fail when a user provided a seemingly valid URL. This commit adds more relevant information to the error message. Having set `ALLOWED_EXPORT_PATHS` to `["/tmp", "/home/vagrant/test"]`, the following error messages are shown: ``` $ pulp file remote create --name $REMOTE_NAME --url file://error/vagrant/test/centos-7/PULP_MANIFEST Error: {"url":["The url 'file://error/vagrant/test/centos-7/PULP_MANIFEST' is not in an allowed import path. The path is interpreted as '/error/vagrant/test/centos-7/PULP_MANIFEST'"]} $ pulp file remote create --name $REMOTE_NAME --url file://home/vagrant/test/centos-7/PULP_MANIFEST OK $ pulp file repository sync --name $REPO_NAME --remote $REMOTE_NAME Started background task /pulp/api/v3/tasks/b4748fc7-cec9-425d-b39e-46fcb9097153/ Error: Task /pulp/api/v3/tasks/b4748fc7-cec9-425d-b39e-46fcb9097153/ failed: '[ErrorDetail(string="The url 'file://home/vagrant/test/centos-7/PULP_MANIFEST' is not in an allowed import path. The path is interpreted as '/var/lib/pulp/tmp/73438@pulp3-source-fedora33.localhost.example.com/tmp2ft_wsar/home/vagrant/test/centos-7/PULP_MANIFEST'", code='invalid')]' ``` [noissue]
- Loading branch information