# Buggy code
def validate_parameters(self, taskcat_cfg, test_list):
    """
    This function validates the parameters file of the CloudFormation template.

    :param taskcat_cfg: TaskCat config yaml object
    :param test_list: List of tests

    :return: TRUPrintMsg.ERROR if the parameters file is valid, else FALSE
    """
    for test in test_list:
        self.define_tests(taskcat_cfg, test)
        print(self.nametag + " |Validate JSON input in test[%s]" % test)
        if self.verbose:
            print(PrintMsg.DEBUG + "parameter_path = %s" % self.get_parameter_path())

        inputparms = self.get_s3contents(self.get_parameter_path())
        jsonstatus = self.check_json(inputparms)

        if self.verbose:
            print(PrintMsg.DEBUG + "jsonstatus = %s" % jsonstatus)

        if jsonstatus:
            print(PrintMsg.PASS + "Validated [%s]" % self.get_parameter_file())
        else:
            print(PrintMsg.DEBUG + "parameter_file = %s" % self.get_parameter_file())
            raise TaskCatException("Cannot validate %s" % self.get_parameter_file())
    return True


# Traceback (botocore.exceptions.ClientError)
·[0;30;43m[INFO ]·[0m :Creating bucket taskcat-tag-CfnLintDemo-0a074b3f in us-east-2
Traceback (most recent call last):
File "/usr/local/bin/taskcat", line 79, in <module>
main()
File "/usr/local/bin/taskcat", line 65, in main
tcat_instance.stage_in_s3(taskcat_cfg)
File "/usr/local/lib/python3.6/site-packages/taskcat/stacker.py", line 428, in stage_in_s3
'LocationConstraint': self.get_default_region()
File "/usr/local/lib/python3.6/site-packages/botocore/client.py", line 320, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python3.6/site-packages/botocore/client.py", line 623, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidBucketName) when calling the CreateBucket operation: The specified bucket is not valid.
[Container] 2018/10/31 04:40:24 Command did not exit successfully taskcat -c $PROJECTNAME/ci/taskcat.yml exit status 1

# Fixed code
def validate_parameters(self, taskcat_cfg, test_list):
    """
    This function validates the parameters file of the CloudFormation template.

    :param taskcat_cfg: TaskCat config yaml object
    :param test_list: List of tests

    :return: TRUPrintMsg.ERROR if the parameters file is valid, else FALSE
    """
    for test in test_list:
        self.define_tests(taskcat_cfg, test)
        print(self.nametag + " |Validate JSON input in test[%s]" % test)
        if self.verbose:
            print(PrintMsg.DEBUG + "parameter_path = %s" % self.get_parameter_path())

        inputparms = self.get_contents(
            "./" + self.get_project() + "/ci/" + self.get_parameter_file()
        )
        jsonstatus = self.check_json(inputparms)

        if self.verbose:
            print(PrintMsg.DEBUG + "jsonstatus = %s" % jsonstatus)

        if jsonstatus:
            print(PrintMsg.PASS + "Validated [%s]" % self.get_parameter_file())
        else:
            print(PrintMsg.DEBUG + "parameter_file = %s" % self.get_parameter_file())
            raise TaskCatException("Cannot validate %s" % self.get_parameter_file())
    return True