Wiredcraft / dopy

Digital Ocean Python
MIT License
95 stars 62 forks source link

basestring is incompatible with python 3 #61

Open PatrickVanRietschoten opened 7 years ago

PatrickVanRietschoten commented 7 years ago

When I try to run dopy in combination with python 3 I get the following error:

name 'basestring' is not defined

Uncommenting the following line works for me:

https://github.com/Wiredcraft/dopy/blob/master/dopy/manager.py#L83

I do have to make sure that ssh_keys is an array.

(Thank you author for this very good plugin!)

mjmare commented 6 years ago

Same here

stphnthiel commented 6 years ago

+1

mjmare commented 6 years ago

I found a version of dopy working with python3: https://github.com/rolylolypoly/dopy

rdezavalia commented 6 years ago

Adding:

try: basestring except NameError: basestring = str

at the top of manager.py fix this.

Franky1 commented 5 years ago

+1 seems this project here is not maintained anymore, since it is outdated and there are a lot of forks ahead of this... The annoying thing is, that this is the (outdated) module that is pulled by pip install dopy ;-(

Therefore i installed a forked repo manually instead from: https://github.com/dfundingsland/dopy This fork works in Python 3 so far.

There is also an ongoing discussion to integrate DigitalOcean API into the Ansible Core that can be found under this issue: https://github.com/ansible/ansible/issues/29740 But the integration seems to be not finished yet.

rborer commented 5 years ago

Howdy,

For info I tried to use https://github.com/dfundingsland/dopy fork with Ansible 2.7.9 and incidentally realized that it creates a new droplet at each invocation even if a droplet with the same name exists.

It looks like the function all_active_droplets() of this fork does only return a single droplet. Beware if you're planning or using this fork :bomb: