diff --git a/aws_fusion/__init__.py b/aws_fusion/__init__.py index 51ed7c4..c3b3841 100644 --- a/aws_fusion/__init__.py +++ b/aws_fusion/__init__.py @@ -1 +1 @@ -__version__ = '1.5.1' +__version__ = '1.5.2' diff --git a/aws_fusion/commands/config_switch.py b/aws_fusion/commands/config_switch.py index 894b521..ba25436 100644 --- a/aws_fusion/commands/config_switch.py +++ b/aws_fusion/commands/config_switch.py @@ -31,7 +31,7 @@ def switch_profile(args): answers = inquirer.prompt([profile_inquiry], theme=inquirer.themes.GreenPassion(), raise_keyboard_interrupt=True) except KeyboardInterrupt: LOG.warning('Cancelled by user') - exit(7) + exit(73) profile = answers.get('profile') if answers.get('profile') != 'default' else None __update_file('profile', profile) @@ -46,7 +46,7 @@ def switch_region(args): answers = inquirer.prompt([region_inquery], theme=inquirer.themes.GreenPassion(), raise_keyboard_interrupt=True) except KeyboardInterrupt: LOG.warning('Cancelled by user') - exit(7) + exit(73) region = answers.get('region') if answers.get('region') != session.region_name else None __update_file('region', region) diff --git a/bin/_awsp b/bin/_awsp index 292c8f6..f771db4 100644 --- a/bin/_awsp +++ b/bin/_awsp @@ -1,10 +1,12 @@ #!/bin/bash aws-fusion config-switch profile +# If non-zero status from program, then exit from here +[ $? -ne 0 ] && return selected_profile="$(cat ~/.aws/fusion/profile)" -# Unset region as switching profile +# Unset region as switching profile, will use the region which is set by the profile unset AWS_REGION if [ -z "$selected_profile" ] diff --git a/bin/_awsr b/bin/_awsr index eb26762..0b15b77 100644 --- a/bin/_awsr +++ b/bin/_awsr @@ -1,6 +1,8 @@ #!/bin/bash aws-fusion config-switch region +# If non-zero status from program, then exit from here +[ $? -ne 0 ] && return selected_region="$(cat ~/.aws/fusion/region)"