Fix issue where unicode aren't interpreted as custom fields in host

Change-Id: I829476e161f9bec9d8ee8326cf559e9203385779
This commit is contained in:
Vincent Fournier 2015-05-08 11:00:16 -04:00
parent 576f26a08c
commit 855f94eb85
1 changed files with 4 additions and 1 deletions

View File

@ -56,7 +56,10 @@ class Host(types.Base):
# Custom fields start with '_'. Detect them ans assign them.
custom_fields = [i for i in kwargs.items()
if isinstance(i[0], str) and i[0][0] == '_']
if (isinstance(i[0], str)
or isinstance(i[0], unicode))
and i[0][0] == '_']
if len(custom_fields) > 0:
self.custom_fields = {}
for item in custom_fields: