dopy icon indicating copy to clipboard operation
dopy copied to clipboard

basestring is incompatible with python 3

Open PatrickVanRietschoten opened this issue 8 years ago • 6 comments

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!)

PatrickVanRietschoten avatar Nov 04 '17 10:11 PatrickVanRietschoten

Same here

mjmare avatar Nov 20 '17 19:11 mjmare

+1

stphnthiel avatar Nov 29 '17 19:11 stphnthiel

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

mjmare avatar Mar 16 '18 20:03 mjmare

Adding:

try: basestring except NameError: basestring = str

at the top of manager.py fix this.

rdezavalia avatar Jul 25 '18 17:07 rdezavalia

+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.

Franky1 avatar Nov 14 '18 11:11 Franky1

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:

rborer avatar Apr 08 '19 11:04 rborer