Open y8 opened 2 years ago
I have the same issue. System: Debian 11
config file = /home/user/workspace/debug_DigitalOcean_Droplet_Management/ansible.cfg
configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.9/dist-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
Collection
# /home/user/.ansible/collections/ansible_collections
Collection Version
---------------------- -------
community.digitalocean 1.12.0
Manifest
- name: Create a new droplet
community.digitalocean.digital_ocean_droplet:
state: present
name: mydroplet
oauth_token: XXX
size: 2gb
region: sfo1
image: ubuntu-18-04-x64
wait_timeout: 500
ssh_keys: [ .... ]
register: my_droplet
Issue is the same as in topic Thanks for support
SUMMARY
When API returns 500 status,
digital_ocean_droplet
withaction: create
raises python error.ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
MacBookAir10,1 (M1, aarch64) Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:24 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T8101 arm64
STEPS TO REPRODUCE
You can't reproduce actual API failure, but it can be reproduced by mocking response with code 500 and body:
Raised
'NoneType' object has no attribute 'get'
Stacktrace points to: https://github.com/ansible-collections/community.digitalocean/blob/3e81f0c9ac16cd34aff609577b359deb0028e7a3/plugins/modules/digital_ocean_droplet.py#L708I suppose
status_code
should be checked beforedroplet
anddroplet_id
are fetched from responseThanks!