Skip to content

describe_images() doesn't work for me ? #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wzymaster opened this issue Jul 10, 2015 · 5 comments
Open

describe_images() doesn't work for me ? #21

wzymaster opened this issue Jul 10, 2015 · 5 comments

Comments

@wzymaster
Copy link

I have successfully created ECS connection with 'cn-beijing' and all other functions work fine, like create_and_start_instance(), stop_instance(), delete_instance() , etc.

However, it always failed to list all images and here is what I get :

_conn.describe_images()
[Traceback (most recent call last):
File "", line 1, in
UnicodeEncodeError: 'ascii' codec can't encode character u'\u4f4d' in position 119: ordinal not in range(128)

Can you help with it ?

@heikkiquixey
Copy link
Contributor

Unfortunately the package isn't playing well with non-ASCII strings. Creating and deleting instances seems to work, luckily, but anytime there is any string building or displaying it is likely to blow up due to non-ASCII characters in some field.

@wzymaster
Copy link
Author

@heikkiquixey any work around to let me get list of all available images ?

@heikkiquixey
Copy link
Contributor

I don't think I have needed to do that yet, so I don't know. You might want to see where exactly in the code it is blowing up and then you should be able to convert the strings properly (rather than just assuming str() or unicode() will work).

@addumb
Copy link
Contributor

addumb commented Jul 13, 2015

Mebbe something like this?

imgs = _conn.describe_images()
for i in imgs: print i.name

The method grabs the objects from the API, it can't __repr__() them to the interactive interpreter UI, though...

@addumb
Copy link
Contributor

addumb commented Aug 15, 2015

This can work if the bad strings are printed out to a console rather than the interactive terminal I think. I no longer have access credentials, so it's a little more difficult for me to troubleshoot this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants