NSX|V fix Tasks logging to not crash on non-ascii characters

If the task name contains non-ascii characters (for example this could be
the router name) we should do the ascii encoding with ignore-errors flag

Change-Id: I12cc07854e08cfb48d9cf1d53e6a5fafa2a3626e
This commit is contained in:
Adit Sarfaty 2016-05-18 18:19:52 +03:00
parent 539833fff4
commit 7f2c60470f
1 changed files with 3 additions and 1 deletions

View File

@ -145,7 +145,9 @@ class Task():
def __repr__(self):
return "Task-%s-%s-%s" % (
self.name, self.resource_id, self.id)
self.name.encode('ascii', 'ignore'),
self.resource_id.encode('ascii', 'ignore'),
self.id)
class TaskManager():