def run(self, command: str) -> None:
"""Execute one of the available commands.
Args:
command: Command in self.commands.
"""
boto3.setup_default_session(region_name=self._config.aws_region)
# Validate the configuration.
try:
if command not in {'compile_rules', 'configure', 'unit_test'}:
self._config.validate()
getattr(self, command)() # Command validation already happened in the ArgumentParser.
except InvalidConfigError as error:
sys.exit('ERROR: {}\nPlease run "python3 manage.py configure"'.format(error))
except TestFailureError as error:
sys.exit('TEST FAILED: {}'.format(error))
评论列表
文章目录