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.
If a user provides the
--output <type>
via a command line argument, we get the validation via argparse'schoices
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:This is because
get_formatter()
returnsNone
and we try to call aNone
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 inget_formatter
itself.