Skip to content

Commit

Permalink
Add get_linked_account_by_name Back For Validation (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
kolanos authored Feb 12, 2021
1 parent 92ec034 commit ff38086
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions newrelic_lambda_cli/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ def get_linked_account_by_external_id(self, external_id):
except KeyError:
return None

def get_linked_account_by_name(self, name):
"""
return a specific linked account of the New Relic account by name
"""
accounts = self.get_linked_accounts()
try:
return next((a for a in accounts if a["name"] == name), None)
except KeyError:
return None

def link_account(self, role_arn, account_name):
"""
create a linked account (cloud integrations account)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="newrelic-lambda-cli",
version="0.5.3",
version="0.5.4",
python_requires=">=3.3",
description="A CLI to install the New Relic AWS Lambda integration and layers.",
long_description=README,
Expand Down

0 comments on commit ff38086

Please sign in to comment.