Replace unicode with six.text_type
The Unicode type is 'unicode' in Python 2 and 'str' on Python 3. This patch replaces unicode with six.text_type to make Murano Agent more compatible with Python 3. Blueprint murano-python-3-support Change-Id: I03788fdfe69c16831406244fd5720a82720775cf
This commit is contained in:
parent
86d1aa2d91
commit
e98af85e74
|
@ -13,6 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import six
|
||||
import uuid
|
||||
|
||||
from oslo_utils import timeutils
|
||||
|
@ -47,7 +48,7 @@ class ExecutionResult(object):
|
|||
if isinstance(error, int):
|
||||
error_code = error
|
||||
elif isinstance(error, Exception):
|
||||
message = unicode(error)
|
||||
message = six.text_type(error)
|
||||
if isinstance(error, exc.AgentException):
|
||||
error_code = error.error_code
|
||||
additional_info = error.additional_data
|
||||
|
|
Loading…
Reference in New Issue