aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.34k stars 4.08k forks source link

Validate output types from config file #600

Closed jamesls closed 10 years ago

jamesls commented 10 years ago

If a user provides the --output <type> via a command line argument, we get the validation via argparse's choices option. However, if they set the output format in their config file and set it to an invalid value, they get an bad error message:

$ aws swf list-domains --registration-status REGISTERED
'NoneType' object is not callable

This is because get_formatter() returns None and we try to call a None value.

Given we can't validate a config when a user changes their config file, we can at least add validation that get_formatter should not return a None value. It might even make sense to just raise an exception in get_formatter itself.

jamesls commented 10 years ago

Closing, this was fixed in #716.