Replace utils.to_bytes() with strutils.to_bytes()

The to_bytes() function have moved to oslo.
Replaced/removed the to_bytes() function with the one in strutils.

Change-Id: I53947b7a333057fec738a02f5643be59e563290d
Remove usage of locals() for formatting from cinder.api.*

Using of locals() for formatting string is a nasty thing because:
1) It is not so clear as using explicit dicts
2) It could produce hidden errors during refactoring
3) Changing name of variable causes change in message
4) Creating a lot of unused variables

Fix bug 1171936

Change-Id: Id6a900899db328be067b8139a49c12ce802dd415
Use Python 3.x compatible except: construct

Per (proposed) H203 check, convert all uses of
the deprecated except x,y: construct to except
x as y:, which works with any Python version >= 2.6

Change-Id: I5528dc556f3ef8d356e01d59df04ba57f66c95b7
Merge "Replace utils.to_bytes() with strutils.to_bytes()"
Merge "Remove usage of locals() for formatting from cinder.api.*"
Merge "Use Python 3.x compatible except: construct"