Skip to content

Commit

Permalink
Merge pull request #442 from /issues/441
Browse files Browse the repository at this point in the history
fixes #441 - unhandled exception during TA polling
  • Loading branch information
jantman committed Oct 31, 2019
2 parents 86be144 + d2da900 commit d65e897
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Unreleased Changes

* `Issue #429 <https://github.com/jantman/awslimitchecker/issues/429>`_ - add 87 missing EC2 instance types. This will now only impact ``cn-*`` and ``us-gov-*`` regions.
* `Issue #433 <https://github.com/jantman/awslimitchecker/issues/433>`_ - Fix broken links in the docs; waffle.io and landscape.io are both gone, sadly.
* `Issue #441 <https://github.com/jantman/awslimitchecker/issues/441>`_ - Fix critical bug where awslimitchecker would die with an unhandled ``botocore.exceptions.ParamValidationError`` exception in accounts that have Trusted Advisor but do not have a "Service Limits" check in the "performance" category.

New EC2 vCPU Limits
+++++++++++++++++++
Expand Down
4 changes: 2 additions & 2 deletions awslimitchecker/tests/test_trustedadvisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,10 @@ def setup(self):
def test_none(self):
tmp = self.mock_conn.describe_trusted_advisor_check_result
with patch('%s._get_limit_check_id' % pb, autospec=True) as mock_id:
mock_id.return_value = None
mock_id.return_value = (None, None)
res = self.cls._poll()
assert tmp.mock_calls == []
assert res is None
assert res == {}

def test_basic(self):
poll_return_val = {
Expand Down
4 changes: 2 additions & 2 deletions awslimitchecker/trustedadvisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ def _poll(self):
if not self.have_ta:
logger.info('TrustedAdvisor.have_ta is False; not polling TA')
return {}
if tmp is None:
if tmp[0] is None:
logger.critical("Unable to find 'Service Limits' Trusted Advisor "
"check; not using Trusted Advisor data.")
return
return {}
check_id, metadata = tmp
checks = self._get_refreshed_check_result(check_id)
region = self.ta_region or self.conn._client_config.region_name
Expand Down

0 comments on commit d65e897

Please sign in to comment.