ddfs.py: Backport of a774a178492e5eaecb0b6a7

https://github.com/discoproject/disco/commit/a774a178492e5eaec#diff-98cec05b141d0f5b9db71b7276e1ab04R384