mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Assorted pylint fixes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
|
||||
# Copyright: Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
@@ -127,7 +127,7 @@ class DOBlockStorage(object):
|
||||
return v
|
||||
|
||||
def poll_action_for_complete_status(self, action_id):
|
||||
url = 'actions/{}'.format(action_id)
|
||||
url = 'actions/{0}'.format(action_id)
|
||||
end_time = time.time() + self.module.params['timeout']
|
||||
while time.time() < end_time:
|
||||
time.sleep(2)
|
||||
@@ -142,7 +142,7 @@ class DOBlockStorage(object):
|
||||
raise DOBlockStorageException('Unable to reach api.digitalocean.com')
|
||||
|
||||
def get_attached_droplet_ID(self, volume_name, region):
|
||||
url = 'volumes?name={}®ion={}'.format(volume_name, region)
|
||||
url = 'volumes?name={0}®ion={1}'.format(volume_name, region)
|
||||
response = self.rest.get(url)
|
||||
status = response.status_code
|
||||
json = response.json
|
||||
@@ -207,7 +207,7 @@ class DOBlockStorage(object):
|
||||
def delete_block_storage(self):
|
||||
volume_name = self.get_key_or_fail('volume_name')
|
||||
region = self.get_key_or_fail('region')
|
||||
url = 'volumes?name={}®ion={}'.format(volume_name, region)
|
||||
url = 'volumes?name={0}®ion={1}'.format(volume_name, region)
|
||||
attached_droplet_id = self.get_attached_droplet_ID(volume_name, region)
|
||||
if attached_droplet_id is not None:
|
||||
self.attach_detach_block_storage('detach', volume_name, region, attached_droplet_id)
|
||||
|
||||
Reference in New Issue
Block a user