Assorted pylint fixes

This commit is contained in:
Dag Wieers
2019-02-14 21:02:27 +01:00
committed by Matt Clay
parent 8e0f95951d
commit f9ab9b4d68
65 changed files with 343 additions and 473 deletions

View File

@@ -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={}&region={}'.format(volume_name, region)
url = 'volumes?name={0}&region={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={}&region={}'.format(volume_name, region)
url = 'volumes?name={0}&region={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)