Bug #23958
closed[API] Template import from local directory is throwing directory not found error
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1575975
Description of problem:
The import from local directory through API calls isnt functinal, its throwing directory not found error as following :
---------------------------------------------------
"message":"Something went wrong during export: Using file-based synchronization, but couldn't find /tmp/now"}
---------------------------------------------------
Here '/tmp/now' folder is created and with right permissions still the issue is misleading.
Version-Release number of selected component (if applicable):
Satellite 6.4.0 snap 2
How reproducible:
Always
1. Create a local directory in satellite with foreman owner and correct SELinux policy
2. Create template erb file in that directory
3. Set that directory as 'Repo' in settings
4. Attempt to import above template from API end:
- curl -H "Accept: application/json" -H "Content-Type: application/json" -k -X POST -u admin:passwd https://mysatellite.com/api/v2/templates/export -d '{"verbose": "true", "associate": "new"}'
Actual results: {"message":"Something went wrong during export: Using file-based synchronization, but couldn't find /tmp/now"}
Expected results:
The template should be imported.
Additional info: