Skip to content

Commit

Permalink
Merge pull request lukecyca#43 from simoon78/patch-1
Browse files Browse the repository at this point in the history
Only include the key if auth is non-empty
  • Loading branch information
lukecyca committed Sep 10, 2014
2 parents 9c13053 + 35fc7ed commit 968beda
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions pyzabbix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,22 @@ def api_version(self):
return self.apiinfo.version()

def do_request(self, method, params=None):
request_json = {
'jsonrpc': '2.0',
'method': method,
'params': params or {},
'auth': self.auth,
'id': self.id,
}
if self.auth:
request_json = {
'jsonrpc': '2.0',
'method': method,
'params': params or {},
'auth': self.auth,
'id': self.id,
}
else:
request_json = {
'jsonrpc': '2.0',
'method': method,
'params': params or {},
'id': self.id,
}


logger.debug("Sending: %s", json.dumps(request_json,
indent=4,
Expand Down

0 comments on commit 968beda

Please sign in to comment.