Skip to content

Commit

Permalink
#368 Update type of verify config
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Dec 14, 2018
1 parent 92d8e2a commit 396ee09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 2 additions & 1 deletion analyzers/IBMXForce/IBMXForce_Lookup.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"description": "Enable/Disable certificate verification",
"required": false,
"multi": false,
"type": "string"
"type": "boolean",
"default": true
}
]
}
8 changes: 1 addition & 7 deletions analyzers/IBMXForce/ibmxforce_lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,11 @@ def __init__(self):
self.url = self.get_param('config.url', None, 'Missing API url')
self.key = self.get_param('config.key', None, 'Missing API key')
self.pwd = self.get_param('config.pwd', None, 'Missing API password')
self.verify = self.str2bool(self.get_param('config.verify', True))
self.verify = self.get_param('config.verify', True)
if not self.verify:
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
self.proxies = self.get_param('config.proxy', None)

def str2bool(self, v):
if isinstance(v, str) or isinstance(v, int) or isinstance(v, unicode) :
return v.lower() in ("yes", "true", "t", "1")
if isinstance(v, bool):
return v

def parse_data(self, date):
try:
date = datetime.strptime(date, "%Y-%m-%dT%H:%M:%S.%fZ")
Expand Down

0 comments on commit 396ee09

Please sign in to comment.