Adjust require order in cloudlaunch controller.
Truncate big job metric values.
Wasn't needed for sqlite based testing - but based on Nicola's experience must be for some other database backend.

https://bitbucket.org/galaxy/galaxy-central/commits/a45f6e57f3d5a4075430a6d460a6cade#comment-924461
Use Nicola's improved logic for env output parsing for env metrics plugin.
Very well laid out here https://bitbucket.org/galaxy/galaxy-central/commits/a45f6e57f3d5a4075430a6d460a6cade#comment-924461 with examples. The one modification I made was to move the logic for truncated large property values into the model layer so it applies for all plugins.
Slightly more defensive job metrics env parsing.

The env string potentially may not match exactly if there are problems reading or recording env output. Log the problem and leave the parsing loop.
Use correctly cased PyYAML
Remove duplicated code block - error in stable->central merge at some point I guess?
Simplify command for grabbing tool in get_work_dir_outputs.

Subtlely reduces code duplication and makes runners slightly easier to unit test (fewer dependencies).
Rework some error handling in local runner.

This way if something goes wrong in failing job - the original exception is reported.
Unit tests for local job runner.

Test running, capturing standard output and exit code, killing job, setting metadata, adding Galaxy to jobs PYTHONPATH, GALAXY_SLOTS logic (default and overidding).
Refactor small __poll helper method out of local job runner's queue.
Local job runner - only poll if limits set (so can be set).

Small optimization.
Allow setting metadata as part of local job.

Any idea why this isn't the default when it is for other runners?
Rework local job runner to create job script.
Backport CLI-manager infrastructure from LWR.

I had previously reworked this CLI stuff to work with LWR - this changeset brings those changes back to Galaxy. This version has the advantage of using the job script module - the upshot is that GALAXY_SLOTS, job_conf env directives, and job metrics should all be usable now with the CLI runner. This version also has a local shell variant (to eliminate the use of SSH and run qsub directly on the same machine) and some other small bug fixes.