Skip to content
Snippets Groups Projects
Commit f0ef7773 authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-playbooks/general#85 Linting

parent 84278118
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ import os
import requests
import tempfile
import yaml
import ConfigParser
import configparser
from ansible.errors import AnsibleError as ae
from ansible.plugins.action import ActionBase
......@@ -65,7 +65,7 @@ class ActionModule(ActionBase):
result['msg'] = 'Uptime not configured'
result['changed'] = False
return result
self.config = ConfigParser.ConfigParser()
self.config = configparser.ConfigParser()
self.config.read(configPath)
section = 'Credentials'
if self.config.has_option(section, 'url') and self.config.has_option(section, 'username') and self.config.has_option(section, 'password'):
......@@ -144,7 +144,7 @@ class ActionModule(ActionBase):
request_result = requests.put(self.url + '/api/' + path, auth = auth, data = postData)
elif method == 'DELETE':
request_result = requests.delete(self.url + '/api/' + path, auth = auth)
except ae, e:
except ae as e:
raise ae('No result from Uptime API')
display.vvvvvv(request_result)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment