Fix some "make pep8" errors in the digital_ocean module.
This commit is contained in:
parent
bb36429fa2
commit
a1738163a8
1 changed files with 11 additions and 11 deletions
|
@ -186,9 +186,9 @@ class Droplet(JsonfyMixIn):
|
||||||
self.power_on()
|
self.power_on()
|
||||||
|
|
||||||
if wait:
|
if wait:
|
||||||
end_time = time.time()+wait_timeout
|
end_time = time.time() + wait_timeout
|
||||||
while time.time() < end_time:
|
while time.time() < end_time:
|
||||||
time.sleep(min(20, end_time-time.time()))
|
time.sleep(min(20, end_time - time.time()))
|
||||||
self.update_attr()
|
self.update_attr()
|
||||||
if self.is_powered_on():
|
if self.is_powered_on():
|
||||||
if not self.ip_address:
|
if not self.ip_address:
|
||||||
|
@ -283,18 +283,18 @@ def core(module):
|
||||||
droplet = Droplet.find(module.params['id'])
|
droplet = Droplet.find(module.params['id'])
|
||||||
if not droplet:
|
if not droplet:
|
||||||
droplet = Droplet.add(
|
droplet = Droplet.add(
|
||||||
name=getkeyordie('name'),
|
name=getkeyordie('name'),
|
||||||
size_id=getkeyordie('size_id'),
|
size_id=getkeyordie('size_id'),
|
||||||
image_id=getkeyordie('image_id'),
|
image_id=getkeyordie('image_id'),
|
||||||
region_id=getkeyordie('region_id'),
|
region_id=getkeyordie('region_id'),
|
||||||
ssh_key_ids=module.params['ssh_key_ids']
|
ssh_key_ids=module.params['ssh_key_ids']
|
||||||
)
|
)
|
||||||
if droplet.is_powered_on():
|
if droplet.is_powered_on():
|
||||||
changed = False
|
changed = False
|
||||||
droplet.ensure_powered_on(
|
droplet.ensure_powered_on(
|
||||||
wait=getkeyordie('wait'),
|
wait=getkeyordie('wait'),
|
||||||
wait_timeout=getkeyordie('wait_timeout')
|
wait_timeout=getkeyordie('wait_timeout')
|
||||||
)
|
)
|
||||||
module.exit_json(changed=changed, droplet=droplet.to_json())
|
module.exit_json(changed=changed, droplet=droplet.to_json())
|
||||||
|
|
||||||
elif state in ('absent', 'deleted'):
|
elif state in ('absent', 'deleted'):
|
||||||
|
|
Loading…
Reference in a new issue