mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 14:41:23 -07:00
Pep8 fixes for digital_ocean_*
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
9c5b55232c
commit
2425143cf2
5 changed files with 53 additions and 53 deletions
|
@ -211,12 +211,14 @@ from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
|
|
||||||
class TimeoutError(Exception):
|
class TimeoutError(Exception):
|
||||||
|
|
||||||
def __init__(self, msg, id_):
|
def __init__(self, msg, id_):
|
||||||
super(TimeoutError, self).__init__(msg)
|
super(TimeoutError, self).__init__(msg)
|
||||||
self.id = id_
|
self.id = id_
|
||||||
|
|
||||||
|
|
||||||
class JsonfyMixIn(object):
|
class JsonfyMixIn(object):
|
||||||
|
|
||||||
def to_json(self):
|
def to_json(self):
|
||||||
return self.__dict__
|
return self.__dict__
|
||||||
|
|
||||||
|
@ -432,35 +434,35 @@ def core(module):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec = dict(
|
argument_spec=dict(
|
||||||
command = dict(choices=['droplet', 'ssh'], default='droplet'),
|
command=dict(choices=['droplet', 'ssh'], default='droplet'),
|
||||||
state = dict(choices=['active', 'present', 'absent', 'deleted'], default='present'),
|
state=dict(choices=['active', 'present', 'absent', 'deleted'], default='present'),
|
||||||
api_token = dict(aliases=['API_TOKEN'], no_log=True),
|
api_token=dict(aliases=['API_TOKEN'], no_log=True),
|
||||||
name = dict(type='str'),
|
name=dict(type='str'),
|
||||||
size_id = dict(),
|
size_id=dict(),
|
||||||
image_id = dict(),
|
image_id=dict(),
|
||||||
region_id = dict(),
|
region_id=dict(),
|
||||||
ssh_key_ids = dict(type='list'),
|
ssh_key_ids=dict(type='list'),
|
||||||
virtio = dict(type='bool', default='yes'),
|
virtio=dict(type='bool', default='yes'),
|
||||||
private_networking = dict(type='bool', default='no'),
|
private_networking=dict(type='bool', default='no'),
|
||||||
backups_enabled = dict(type='bool', default='no'),
|
backups_enabled=dict(type='bool', default='no'),
|
||||||
id = dict(aliases=['droplet_id'], type='int'),
|
id=dict(aliases=['droplet_id'], type='int'),
|
||||||
unique_name = dict(type='bool', default='no'),
|
unique_name=dict(type='bool', default='no'),
|
||||||
user_data = dict(default=None),
|
user_data=dict(default=None),
|
||||||
ipv6 = dict(type='bool', default='no'),
|
ipv6=dict(type='bool', default='no'),
|
||||||
wait = dict(type='bool', default=True),
|
wait=dict(type='bool', default=True),
|
||||||
wait_timeout = dict(default=300, type='int'),
|
wait_timeout=dict(default=300, type='int'),
|
||||||
ssh_pub_key = dict(type='str'),
|
ssh_pub_key=dict(type='str'),
|
||||||
),
|
),
|
||||||
required_together = (
|
required_together=(
|
||||||
['size_id', 'image_id', 'region_id'],
|
['size_id', 'image_id', 'region_id'],
|
||||||
),
|
),
|
||||||
mutually_exclusive = (
|
mutually_exclusive=(
|
||||||
['size_id', 'ssh_pub_key'],
|
['size_id', 'ssh_pub_key'],
|
||||||
['image_id', 'ssh_pub_key'],
|
['image_id', 'ssh_pub_key'],
|
||||||
['region_id', 'ssh_pub_key'],
|
['region_id', 'ssh_pub_key'],
|
||||||
),
|
),
|
||||||
required_one_of = (
|
required_one_of=(
|
||||||
['id', 'name'],
|
['id', 'name'],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -325,15 +325,15 @@ def handle_request(module):
|
||||||
def main():
|
def main():
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
state = dict(choices=['present', 'absent'], required=True),
|
state=dict(choices=['present', 'absent'], required=True),
|
||||||
command = dict(choices=['create', 'attach'], required=True),
|
command=dict(choices=['create', 'attach'], required=True),
|
||||||
api_token = dict(aliases=['API_TOKEN'], no_log=True),
|
api_token=dict(aliases=['API_TOKEN'], no_log=True),
|
||||||
block_size = dict(type='int'),
|
block_size=dict(type='int'),
|
||||||
volume_name = dict(type='str', required=True),
|
volume_name=dict(type='str', required=True),
|
||||||
description = dict(type='str'),
|
description=dict(type='str'),
|
||||||
region = dict(type='str', required=True),
|
region=dict(type='str', required=True),
|
||||||
droplet_id = dict(type='int'),
|
droplet_id=dict(type='int'),
|
||||||
timeout = dict(type='int', default=10),
|
timeout=dict(type='int', default=10),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -99,6 +99,7 @@ from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
|
|
||||||
class JsonfyMixIn(object):
|
class JsonfyMixIn(object):
|
||||||
|
|
||||||
def to_json(self):
|
def to_json(self):
|
||||||
return self.__dict__
|
return self.__dict__
|
||||||
|
|
||||||
|
@ -226,14 +227,14 @@ def core(module):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec = dict(
|
argument_spec=dict(
|
||||||
state = dict(choices=['present', 'absent'], default='present'),
|
state=dict(choices=['present', 'absent'], default='present'),
|
||||||
api_token = dict(aliases=['API_TOKEN'], no_log=True),
|
api_token=dict(aliases=['API_TOKEN'], no_log=True),
|
||||||
name = dict(type='str'),
|
name=dict(type='str'),
|
||||||
id = dict(aliases=['droplet_id'], type='int'),
|
id=dict(aliases=['droplet_id'], type='int'),
|
||||||
ip = dict(type='str'),
|
ip=dict(type='str'),
|
||||||
),
|
),
|
||||||
required_one_of = (
|
required_one_of=(
|
||||||
['id', 'name'],
|
['id', 'name'],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -86,6 +86,7 @@ from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
|
|
||||||
class JsonfyMixIn(object):
|
class JsonfyMixIn(object):
|
||||||
|
|
||||||
def to_json(self):
|
def to_json(self):
|
||||||
return self.__dict__
|
return self.__dict__
|
||||||
|
|
||||||
|
@ -161,15 +162,15 @@ def core(module):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec = dict(
|
argument_spec=dict(
|
||||||
state = dict(choices=['present', 'absent'], default='present'),
|
state=dict(choices=['present', 'absent'], default='present'),
|
||||||
client_id = dict(aliases=['CLIENT_ID'], no_log=True),
|
client_id=dict(aliases=['CLIENT_ID'], no_log=True),
|
||||||
api_key = dict(aliases=['API_KEY'], no_log=True),
|
api_key=dict(aliases=['API_KEY'], no_log=True),
|
||||||
name = dict(type='str'),
|
name=dict(type='str'),
|
||||||
id = dict(aliases=['droplet_id'], type='int'),
|
id=dict(aliases=['droplet_id'], type='int'),
|
||||||
ssh_pub_key = dict(type='str'),
|
ssh_pub_key=dict(type='str'),
|
||||||
),
|
),
|
||||||
required_one_of = (
|
required_one_of=(
|
||||||
['id', 'name'],
|
['id', 'name'],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -253,10 +253,6 @@ lib/ansible/modules/cloud/cloudstack/cs_vmsnapshot.py
|
||||||
lib/ansible/modules/cloud/cloudstack/cs_volume.py
|
lib/ansible/modules/cloud/cloudstack/cs_volume.py
|
||||||
lib/ansible/modules/cloud/cloudstack/cs_zone.py
|
lib/ansible/modules/cloud/cloudstack/cs_zone.py
|
||||||
lib/ansible/modules/cloud/cloudstack/cs_zone_facts.py
|
lib/ansible/modules/cloud/cloudstack/cs_zone_facts.py
|
||||||
lib/ansible/modules/cloud/digital_ocean/digital_ocean.py
|
|
||||||
lib/ansible/modules/cloud/digital_ocean/digital_ocean_block_storage.py
|
|
||||||
lib/ansible/modules/cloud/digital_ocean/digital_ocean_domain.py
|
|
||||||
lib/ansible/modules/cloud/digital_ocean/digital_ocean_sshkey.py
|
|
||||||
lib/ansible/modules/cloud/docker/_docker.py
|
lib/ansible/modules/cloud/docker/_docker.py
|
||||||
lib/ansible/modules/cloud/docker/docker_container.py
|
lib/ansible/modules/cloud/docker/docker_container.py
|
||||||
lib/ansible/modules/cloud/docker/docker_image.py
|
lib/ansible/modules/cloud/docker/docker_image.py
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue