Fix tenant isolation and unit tests with py3

This commit fixes several issues in the tenant isolation code and it's
unit tests which were preventing them from passing on python3.

Change-Id: I78d14b64282ae9a8d2d5edc3de65c249681bc13a
2 files changed