示例#1
0
def list_profiles(args):
    keyring = Keyring()
    profiles = keyring.get_all_profiles()
    sessions = keyring.get_all_sessions()
    if len(profiles) == 0:
        print("")
        print("No profiles found. Use \"aws-jumpcloud add <profile>\" to store a new profile.")
        sys.exit(0)

    print("")
    _print_columns(headers=["Profile", "AWS Account", "AWS Role", "IAM session expires"],
                   rows=_format_profile_rows(profiles, sessions))
示例#2
0
def _rotate_all_sessions(args):
    keyring = Keyring()
    profiles = keyring.get_all_profiles()
    if len(profiles) == 0:
        print("")
        print("No profiles found. Use \"aws-jumpcloud add <profile>\" to store a new profile.")
        sys.exit(0)

    _login_to_jumpcloud('--all')
    print("")

    for profile in profiles.values():
        _rotate_single_session(args, profile.name)