# Buggy code
def collect_resources(self, testdata_list, logpath):
    """
    This function collects the AWS resources information created by the
    CloudFormation stack for generating the report.

    :param testdata_list: List of TestData object
    :param logpath: Log file path

    """
    resource = {}
    print(PrintMsg.INFO + "(Collecting Resources)")
    for test in testdata_list:
        for stack in test.get_test_stacks():
            stackinfo = CommonTools(stack["StackId"]).parse_stack_info()
            # Get stack resources
            resource[stackinfo["region"]] = self.get_resources(
                str(stackinfo["stack_name"]), str(stackinfo["region"])
            )
            extension = ".txt"
            test_logpath = "{}/{}-{}-{}{}".format(
                logpath,
                stackinfo["stack_name"],
                stackinfo["region"],
                "resources",
                extension,
            )

            # Write resource logs
            file = open(test_logpath, "w")
            file.write(str(json.dumps(resource, indent=4, separators=(",", ": "))))
            file.close()


# Traceback (TypeError)
22:49:35 [INFO   ] :Few stacks failed to delete. Collecting resources for deep clean-up.
22:49:35 Traceback (most recent call last):
22:49:35   File "/var/lib/jenkins/.local/bin/taskcat", line 104, in <module>
22:49:35     main()
22:49:35   File "/var/lib/jenkins/.local/bin/taskcat", line 97, in main
22:49:35     tcat_instance.cleanup(testdata, 5)
22:49:35   File "/var/lib/jenkins/.local/lib/python3.6/site-packages/taskcat/stacker.py", line 1322, in cleanup
22:49:35     self.deep_cleanup(testdata_list)
22:49:35   File "/var/lib/jenkins/.local/lib/python3.6/site-packages/taskcat/stacker.py", line 1350, in deep_cleanup
22:49:35     failed_stacks = CfnResourceTools.get_all_resources(failed_stack_ids, region)
22:49:35 TypeError: get_all_resources() missing 1 required positional argument: 'region'
22:49:35 Build step 'Execute shell' marked build as failure
22:49:35 Checking console output
22:49:35 Build did not succeed and the project is configured to only push after a successful build, so no pushing will occur.
22:49:35 Finished: FAILURE

# Fixed code
def collect_resources(self, testdata_list, logpath):
    """
    This function collects the AWS resources information created by the
    CloudFormation stack for generating the report.

    :param testdata_list: List of TestData object
    :param logpath: Log file path

    """
    resource = {}
    print(PrintMsg.INFO + "(Collecting Resources)")
    for test in testdata_list:
        for stack in test.get_test_stacks():
            stackinfo = CommonTools(stack["StackId"]).parse_stack_info()
            # Get stack resources
            resource[stackinfo["region"]] = CfnResourceTools(
                self._boto_client
            ).get_resources(str(stackinfo["stack_name"]), str(stackinfo["region"]))
            extension = ".txt"
            test_logpath = "{}/{}-{}-{}{}".format(
                logpath,
                stackinfo["stack_name"],
                stackinfo["region"],
                "resources",
                extension,
            )

            # Write resource logs
            file = open(test_logpath, "w")
            file.write(str(json.dumps(resource, indent=4, separators=(",", ": "))))
            file.close()