Oh, I see, so it can be used in `shell.py`.  yuck

How about moving this flattening code into `master/buildbot/util/__init__.py` and calling it there from both places?