Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Fix Pylint violations W0201
Browse files Browse the repository at this point in the history
  • Loading branch information
sopel committed Apr 15, 2013
1 parent b818696 commit bbdbafa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion botocross/iam/accountinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ def __init__(self, iam_connection):
self.user = None
# populate those attributes not leaked via the exception, if user has no permission for iam:ListAccountAliases
self.alias = botocross.iam.RESOURCE_UNAUTHORIZED
self.id = None

def __repr__(self):
return '<AccountInfo - alias:%s id:%s>' % (self.alias, self.id)

def describe(self, user=None):
self.account = {}
try:
alias = self.connection.get_account_alias()
aliases = alias['list_account_aliases_response']['list_account_aliases_result']['account_aliases']
Expand Down
16 changes: 9 additions & 7 deletions botocross/iam/userinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,22 @@ def __init__(self, iam_connection):
self.path = botocross.iam.RESOURCE_UNAUTHORIZED
self.create_date = botocross.iam.RESOURCE_UNAUTHORIZED
self.id = botocross.iam.RESOURCE_UNAUTHORIZED # TODO: could be deduced from credentials in use instead.
self.arn = None
self.name = None

def __repr__(self):
template = '<UserInfo - path:%s create_date:%s id:%s arn:%s name:%s>'
return template % (self.path, self.create_date, self.id, self.arn, self.name)

def describe(self):
try:
user = self.connection.get_user()
self.user = user['get_user_response']['get_user_result']['user']
self.path = self.user['path']
self.create_date = self.user['create_date']
self.id = self.user['user_id']
self.arn = self.user['arn']
self.name = self.user['user_name']
response = self.connection.get_user()
user = response['get_user_response']['get_user_result']['user']
self.path = user['path']
self.create_date = user['create_date']
self.id = user['user_id']
self.arn = user['arn']
self.name = user['user_name']
except boto.exception.BotoServerError, e:
# NOTE: given some information can be deduced from the exception still, the lack of permissions is
# considered a normal condition still and the exception handled/logged accordingly.
Expand Down

0 comments on commit bbdbafa

Please sign in to comment.