pimutils / pimutils/vdirsyncer
post_hook in [storage] section for type = filesystem doesn't work
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 185
- Avg merge
- 11h 49m
- Merged PRs (30d)
- 1
Description
As far as i know pythons subprocess.call can only execute single commands that way. Executing a more complex command needs shell=True to be set. Furthermore its sometimes useful to specify the path within the command so maybe call subprocess.call like this in FilesystemStorage._run_post_hook:
subprocess.call(self.post_hook.format(fpath), shell=True)
so one can specify a post_hook like this:
post_hook = "/bin/sed -r -i -e '/UID:.*/a CATEGORIES:collected' {0}"
well, in this case, it wouldn't matter, but in other circumstances it might :-)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at FilesystemStorage._run_post_hook and inspect how post_hook is currently passed to subprocess.call. Verify the behavior with a post_hook containing a shell command and a formatted filesystem path, then confirm that the filesystem storage hook executes it as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100