Skip to content
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

basestring is incompatible with python 3 #61

Open
PatrickVanRietschoten opened this issue Nov 4, 2017 · 6 comments
Open

basestring is incompatible with python 3 #61

PatrickVanRietschoten opened this issue Nov 4, 2017 · 6 comments

Comments

@PatrickVanRietschoten
Copy link

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
Copy link

mjmare commented Nov 20, 2017

Same here

@stphnthiel
Copy link

+1

@mjmare
Copy link

mjmare commented Mar 16, 2018

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

@rdezavalia
Copy link

Adding:

try:
basestring
except NameError:
basestring = str

at the top of manager.py fix this.

@Franky1
Copy link

Franky1 commented Nov 14, 2018

+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:
ansible/ansible#29740
But the integration seems to be not finished yet.

cuducos added a commit to okfn-brasil/serenata-de-amor that referenced this issue Feb 6, 2019
As added to the README.md in this commit:

1. The `dopy` Python package Ansible depends on is
   [only available in Python 2](Wiredcraft/dopy#61)
2. We could use a fork, but we
   [would need to trust the fork owner](#449 (comment))
3. Maintaining a fork is out of our scope at the moment

However, Ansible is already
[migrating for an alternative package](ansible/ansible#33984)
and soon (before the end of life of Python 2) we will be able to update.

Thanks, @willianpaixao for the heads up on item #2.
@rborer
Copy link

rborer commented Apr 8, 2019

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 💣

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

6 participants