Skip to content

Commit

Permalink
PR #64 - PEP8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jantman committed Sep 30, 2015
1 parent 51b10a6 commit 68dcc96
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
6 changes: 4 additions & 2 deletions awslimitchecker/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ def __init__(self, warning_threshold=80, critical_threshold=99,
integer percentage, for any limits without a specifically-set
threshold.
:type critical_threshold: int
:param account_id: `AWS Account ID <http://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html>`_
:param account_id: `AWS Account ID <http://docs.aws.amazon.com/general/
latest/gr/acct-identifiers.html>`_
(12-digit string, currently numeric) for the account to connect to
(destination) via STS
:type account_id: str
:param account_role: the name of an
`IAM Role <http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html>`_
`IAM Role <http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.
html>`_
(in the destination account) to assume
:type account_role: str
"""
Expand Down
6 changes: 3 additions & 3 deletions awslimitchecker/tests/test_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def test_init_thresholds(self):
mock_version = mocks['_get_version_info']
mock_version.return_value = self.mock_ver_info
mock_ta_constr = mocks['TrustedAdvisor']
mocks['TrustedAdvisor'].return_value = self.mock_ta
mocks['TrustedAdvisor'].return_value = mock_ta
cls = AwsLimitChecker(
warning_threshold=5,
critical_threshold=22,
Expand Down Expand Up @@ -190,7 +190,7 @@ def test_init_region(self):
mock_version = mocks['_get_version_info']
mock_version.return_value = self.mock_ver_info
mock_ta_constr = mocks['TrustedAdvisor']
mocks['TrustedAdvisor'].return_value = self.mock_ta
mocks['TrustedAdvisor'].return_value = mock_ta
cls = AwsLimitChecker(region='myregion')
# dict should be of _AwsService instances
assert cls.services == {
Expand Down Expand Up @@ -229,7 +229,7 @@ def test_init_sts(self):
mock_version = mocks['_get_version_info']
mock_version.return_value = self.mock_ver_info
mock_ta_constr = mocks['TrustedAdvisor']
mocks['TrustedAdvisor'].return_value = self.mock_ta
mocks['TrustedAdvisor'].return_value = mock_ta
cls = AwsLimitChecker(
account_id='123456789012',
account_role='myrole',
Expand Down
9 changes: 5 additions & 4 deletions awslimitchecker/trustedadvisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@
import boto.support
from dateutil import parser
import logging
from .services.base import _AwsService

logger = logging.getLogger(__name__)

from .services.base import _AwsService

class TrustedAdvisor(_AwsService):

Expand All @@ -64,7 +65,8 @@ def connect(self):
if self.conn is not None:
return
if self.ta_region:
logger.debug("Connecting to Support API (TrustedAdvisor) in %s" % self.region)
logger.debug("Connecting to Support API (TrustedAdvisor) in %s",
self.region)
self.conn = self.connect_via(boto.support.connect_to_region)
else:
logger.debug("Connecting to Support API (TrustedAdvisor)")
Expand Down Expand Up @@ -195,7 +197,7 @@ def _update_services(self, ta_results, services):
lim_name,
svc_name)
logger.info("Done updating TA limits on all services")

def find_usage(self):
raise NotImplementedError('Not applicable')

Expand All @@ -204,4 +206,3 @@ def get_limits(self):

def required_iam_permissions(self):
raise NotImplementedError('Not applicable')

0 comments on commit 68dcc96

Please sign in to comment.