Skip to content

Commit

Permalink
#20 - add additional information in list command
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Wang authored and venth committed Mar 1, 2017
1 parent 673ae33 commit 9d69bd0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions aws_adfs/list_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@ def list_profiles():
"""

config = configparser.RawConfigParser()
config.read(adfs_config.aws_credentials_location)
config.read(adfs_config.aws_config_location)

profiles = config.sections()

config.read(adfs_config.aws_config_location)

if len(profiles) < 1:
click.echo('No defined profiles')
else:
click.echo('Available profiles:')
for profile in profiles:
click.echo(' * {}'.format(profile))
role_arn = config.get(
profile,
'adfs_config.role_arn',
fallback=''
)
click.echo(' * {0:<30} | {1}'.format(profile, role_arn))

0 comments on commit 9d69bd0

Please sign in to comment.