-
Notifications
You must be signed in to change notification settings - Fork 301
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
went through new modified example posted, call to get_events only returns one object #19
Comments
Can you explain better what kind of issue you have? LMK 👍 |
Hey Thank you for looking into this, yes my issue is the following, when I execute this piece of code: #Checking the status of the droplet events = droplet.get_events() for event in events: **** END CODE This for loop only executes one time since there is only one event in the list. So the percentage never gets to 100, since it never iterates through any other events. I also checked by calling a sleep function and then calling status and that never changes to active either. |
You should do something like this:
In that way you should be able to wait until the event is complete. |
Ok, that worked after I modified this line by the following: if '100' in event.percentage: Great. Thank you for all of the hints, I learned a little more about python, debugging and installing modules. |
[crazybill@centos-xx home]# python2.6 new-code.py
Gonna check status in about 10 seconds
Number of events returned by call to droplet.get_events()
1
73
I modified the code to sleep for 10 seconds before calling:
events = droplet.get_events()
I then print the # of events returned on the get_events() call
and print the percentage.
Gonna look deeper to make sure this is not a weird dependency on python build.
Cheers mate.
The text was updated successfully, but these errors were encountered: