Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
[159467985] Multi-user pingdom
Browse files Browse the repository at this point in the history
We have moved to using the GaaP pingdom account, which is using
multi-user Pingdom.

In order to make requests to the Pingdom API for multi-user accounts we
must pass the header 'Account-Email', the value of which is
'[email protected]'.

- Bump the version to 0.3.2
- Get the header from the config
- Pass the header to Pingdom

solo @tlwr
  • Loading branch information
Toby Lorne committed Aug 9, 2018
1 parent 1b137e8 commit 876b24d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion performanceplatform/collector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)

__version__ = "0.3.1"
__version__ = "0.3.2"
__author__ = "GDS Developers"
__author_email__ = "[email protected]"
4 changes: 3 additions & 1 deletion performanceplatform/collector/pingdom/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def __init__(self, config):
self.user = config['user']
self.password = config['password']
self.app_key = config['app_key']
self.account_email = config['account_email']
self.API_LOCATION = "https://api.pingdom.com/api/2.0/"

def _make_request(self, path, url_params=None):
Expand All @@ -21,7 +22,8 @@ def _make_request(self, path, url_params=None):
url=self.API_LOCATION + path,
auth=(self.user, self.password),
headers={
"App-Key": self.app_key
"App-Key": self.app_key,
"Account-Email": self.account_email
},
params=url_params
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def setUp(self):
self.config = {
"user": "[email protected]",
"password": "secret",
"app_key": "12345"
"app_key": "12345",
"account_email": "[email protected]"
}

def test_init_from_config(self):
Expand Down

0 comments on commit 876b24d

Please sign in to comment.