Commit 1e868a6f authored by Giorgos Verigakis's avatar Giorgos Verigakis
Browse files

Try to decode the server name before printing it

parent 5d67fa45
......@@ -74,13 +74,16 @@ class Command(BaseCommand):
for server in servers:
id = str(server.id)
try:
name = server.name.decode('utf8')
except UnicodeEncodeError:
name = server.name
flavor = server.flavor.name
try:
image = get_image(server.imageid, server.userid)['name']
except:
image = server.imageid
fields = (id, server.name, server.userid, flavor, image,
server.operstate)
fields = (id, name, server.userid, flavor, image, server.operstate)
if options['csv']:
line = '|'.join(fields)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment