Remove locals() from various places.

fixes bug 1171936

Remove usage of locals() for string formatting

Change-Id: Ib05538095086ddefdb486c84da506af662ec5c9b
Merge "Remove locals() from various places."