Use six constants to make code Python 3 compatible

Some names are not used in Python 3. Need use six to make them
work in Python 2 and Python 3.
See http://pythonhosted.org/six/#constants

This is mapping:
six Python 2 Python 3
six.integer_types (int, long) int
six.string_types basestring str
six.text_type unicode str

*Sync Python3 comapility fix from Oslo. *NOT* lastest files.
*Use six constants to fill the gaps.

Part of blueprint py33

Change-Id: Ia6dcb86e5fc2e954c2df390e10be4e443c509dc7
Merge "Use six constants to make code Python 3 compatible"