python3: Add python3 compatibility.

Fix basestring/str idioms for both python2 and python3
(used by python-novaclient).

Change-Id: I440c7c1c18660c3d73f699c0a02cbbfee331bfbf
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "python3: Add python3 compatibility."