python3: Refactor dict for python2/python3 compat

Python3 changed the behavior of dict.keys such that it is now
returns a dict_keys object, which is iterable but not indexable.
You can get the python2 result back with an explicit call to list.

Change-Id: Ic504d3929398aa82ac87d1735cf4cedea2dfc5d1
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Sync jsonutils from oslo

Synce the changes of jsonutils from oslo, following fixes are synced:

Ia915f3175bee370d747e362cd9d35d8536c1b7b2
Id1aa7af26b0f5d929337cc373c6a4f802bba2cec
Ic94f238a5f92f28ae1b6154fb56f00c4c9fa3283
I8b246f20f9001379fcb5ca3a84aabee3847cb945

Most of them are py33 fixes, and keystoneclient is required by a dozen of
projects, we should update it to avoid py33 issue in dependent projects.

Closes-Bug #1239602

Change-Id: I65c28896d1551fd537dd7774e87bc479a477a7ab
Merge "Sync jsonutils from oslo"
Merge "python3: Refactor dict for python2/python3 compat"