Optional suggestion:  Working with Yes/No parameters is a little easier if you convert them directly into booleans like: <code>reuse_external = "yes" == params.get("reuse_external", "no")</code>.  It's small thing, but makes the following <code>if</code> statements very clear and easy to read.  Just a suggestion.