anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: aws-ia/taskcat
Issue: AttributeError: module 'botocore.vendored.requests' has no attribute 'get'

**Describe the bug**
vendored version of requests removed from Botocore. Please find below the post from AWS

https://aws.amazon.com/blogs/developer/removing-the-vendored-version-of-requests-from-botocore/

But it's not handled in task cat version taskcat-0.8.47 which is latest

Please find below the error while generating taskcat report.

Traceback (most recent call last): 
  File "/usr/local/bin/taskcat", line 101, in <module> 
    main() 
  File "/usr/local/bin/taskcat", line 90, in main 
    tcat_instance.createreport(testdata, 'index.html') 
  File "/usr/local/lib/python3.6/site-packages/taskcat/stacker.py", line 1495, in createreport 
    cfn_report.generate_report() 
  File "/usr/local/lib/python3.6/site-packages/taskcat/generate_reports.py", line 70, in generate_report 
    output_css = requests.get(css_url).text 
AttributeError: module 'botocore.vendored.requests' has no attribute 'get'

**Version 
 - Taskcat version - taskcat-0.8.47

Changed files:
taskcat/generate_reports.py, taskcat/stacker.py

diff --git a/taskcat/generate_reports.py b/taskcat/generate_reports.py
index 2f042ce..e5685d2 100644
--- a/taskcat/generate_reports.py
+++ b/taskcat/generate_reports.py
@@ -1,7 +1,7 @@
 import time
 import yattag
 
-from botocore.vendored import requests
+import requests
 from taskcat.colored_console import PrintMsg
 from taskcat.common_utils import CommonTools
 from taskcat.exceptions import TaskCatException
diff --git a/taskcat/stacker.py b/taskcat/stacker.py
index 33fc4ed..b49fc78 100644
--- a/taskcat/stacker.py
+++ b/taskcat/stacker.py
@@ -35,7 +35,7 @@ import logging
 import cfnlint.core
 import textwrap
 from argparse import RawTextHelpFormatter
-from botocore.vendored import requests
+import requests
 
 from pkg_resources import get_distribution
Repository: aws-ia/taskcat
Issue: Deep cleanup fails on Jenkins

Bug in deep cleanup

Traceback:
20:21:23 [0;30;43m[INFO   ][0m :Few stacks failed to delete. Collecting resources for deep clean-up.
20:21:23 Traceback (most recent call last):
20:21:23   File "/var/lib/jenkins/.local/bin/taskcat", line 88, in <module>
20:21:23     main()
20:21:23   File "/var/lib/jenkins/.local/bin/taskcat", line 81, in main
20:21:23     tcat_instance.cleanup(testdata, 5)
20:21:23   File "/var/lib/jenkins/.local/lib/python3.6/site-packages/taskcat/stacker.py", line 1320, in cleanup
20:21:23     self.deep_cleanup(testdata_list)
20:21:23   File "/var/lib/jenkins/.local/lib/python3.6/site-packages/taskcat/stacker.py", line 1347, in deep_cleanup
20:21:23     failed_stacks = self.get_all_resources(failed_stack_ids, region)
20:21:23 AttributeError: 'TaskCat' object has no attribute 'get_all_resources'


Changed files:
taskcat/stacker.py

diff --git a/taskcat/stacker.py b/taskcat/stacker.py
index a0e5023..f2ee8c5 100755
--- a/taskcat/stacker.py
+++ b/taskcat/stacker.py
@@ -46,6 +46,7 @@ from taskcat.colored_console import PrintMsg
 from taskcat.generate_reports import ReportBuilder
 from taskcat.common_utils import CommonTools
 from taskcat.cfn_logutils import CfnLogTools
+from taskcat.cfn_resources import CfnResourceTools
 from taskcat.exceptions import TaskCatException
 from taskcat.s3_sync import S3Sync
 from taskcat.common_utils import exit0
@@ -1344,7 +1345,8 @@ class TaskCat(object):
             region = stackdata['region']
             session = boto3.session.Session(region_name=region)
             s = Reaper(session)
-            failed_stacks = self.get_all_resources(failed_stack_ids, region)
+
+            failed_stacks = CfnResourceTools.get_all_resources(failed_stack_ids, region)
             # print all resources which failed to delete
             if self.verbose:
                 print(PrintMsg.DEBUG + "Resources which failed to delete:\\n")
Repository: aws-ia/taskcat
Issue: S3 cleanup was not performed when create stack throws ValidationError

Creating a stack with wrong/lacking parameter input, cfn.create_change_set throws ValidationError. And checking in S3, the uploaded file still exists thus, cleanup was not performed. This is just a minor issue but when ran in different regions and for different projects this would cause burden to the user.

Changed files:
taskcat/stacker.py

diff --git a/taskcat/stacker.py b/taskcat/stacker.py
index 7e96641..bc1574e 100755
--- a/taskcat/stacker.py
+++ b/taskcat/stacker.py
@@ -751,7 +751,10 @@ class TaskCat(object):
             except Exception as e:
                 if self.verbose:
                     print(D + str(e))
-                sys.exit(F + "Cannot validate %s" % self.get_template_file())
+                print(F + "Cannot validate %s" % self.get_template_file())
+                print(I + "Deleting any automatically-created buckets...")
+                self.delete_autobucket()
+                sys.exit(1)
         print('\\n')
         return True
 
@@ -1461,6 +1464,12 @@ class TaskCat(object):
                         ))
                 s.delete_all(failed_stacks)
 
+        self.delete_autobucket()
+
+    def delete_autobucket(self):
+        """
+        This function deletes the automatically created S3 bucket(s) of the current project.
+        """
         # Check to see if auto bucket was created
         if self.get_s3bucket_type() is 'auto':
             print(I + "(Cleaning up staging assets)")
Repository: aws-ia/taskcat
Issue: Decimals break parameters rendering

**Describe the bug**
Providing a custom parameter of type `Number` with a floating point value (like 0.5) will break the regex mechanism of rendering templates.

**To Reproduce**
Provide a floating point numeric parameter.

**Expected behavior**
Parameter expansion to work normally.

**Version**
 - Taskcat Version 0.9.0
-  Python Version 3.6.5

Changed files:
taskcat/_template_params.py

diff --git a/taskcat/_template_params.py b/taskcat/_template_params.py
index a4a5d0d..c091cd6 100644
--- a/taskcat/_template_params.py
+++ b/taskcat/_template_params.py
@@ -224,7 +224,7 @@ class ParamGen:
         Converts a parameter value to string
         No parameters. Operates on (ClassInstance).param_value
         """
-        if isinstance(self.param_value, (int, bytes)):
+        if isinstance(self.param_value, (int, float, bytes)):
             self.param_value = str(self.param_value)
 
     @staticmethod
Repository: aws-ia/taskcat
Issue: URL matching fails with optional region and missing project name

**Describe the bug**
`taskcat test` fails with `FileNotFoundError [Errno 2] No such file or directory: '/home/villasv/projects/aws-airflow-stack/quickstart-turbine-airflow/templates/turbine-workerset.template'`

The correct path taskcat should be trying to access is `'/home/villasv/projects/aws-airflow-stack/templates/turbine-workerset.template'`

After digging up, I can see that there's an inconsistency with URLs when taskcat is reporting statuses for deeply nested stacks. At this section:
https://github.com/aws-quickstart/taskcat/blob/master/taskcat/_cfn/stack.py#L303-L308

For the `quickstart-aws-vpc` submodule, I get `url =  "https://tcat-quickstart-turbine-airflow-1vf1ri9d.s3.amazonaws.com/quickstart-turbine-airflow/submodules/quickstart-aws-vpc/templates/aws-vpc.template"` and `url_prefix() = "https://tcat-quickstart-turbine-airflow-1vf1ri9d.s3.us-east-1.amazonaws.com/quickstart-turbine-airflow"` (note the `us-east-1` extra).

But that doesn't yield an error. Later on, for one of the nested stacks, I get `url = "https://tcat-quickstart-turbine-airflow-1vf1ri9d.s3.amazonaws.com/quickstart-turbine-airflow/templates/turbine-workerset.template"` and `url_prefix() = "https://tcat-quickstart-turbine-airflow-1vf1ri9d.s3.amazonaws.com"` (note the missing project name).

**To Reproduce**
Happening on the develop branch of https://github.com/villasv/aws-airflow-stack

**Version (Please make sure you are running the latest version of taskcat)
 - Taskcat Version: latest master branch (00e3b916533d0cfcad8b43b101819401874fa9cb)

 Note: Python Version 3.6.5

Changed files:
taskcat/_cfn/template.py

diff --git a/taskcat/_cfn/template.py b/taskcat/_cfn/template.py
index 2f42671..5e0f0bd 100644
--- a/taskcat/_cfn/template.py
+++ b/taskcat/_cfn/template.py
@@ -1,4 +1,5 @@
 import logging
+import re
 from pathlib import Path
 from typing import Dict, List, Union
 
@@ -89,9 +90,12 @@ class Template:
     def url_prefix(self) -> str:
         if not self.url:
             return ""
+        regionless_url = re.sub(
+            r"\\.s3\\.(.*)\\.amazonaws\\.com", ".s3.amazonaws.com", self.url,
+        )
         suffix = str(self.template_path).replace(str(self.project_root), "")
         suffix_length = len(suffix.lstrip("/").split("/"))
-        url_prefix = "/".join(self.url.split("/")[0:-suffix_length])
+        url_prefix = "/".join(regionless_url.split("/")[0:-suffix_length])
         return url_prefix
 
     def _find_children(self) -> None:  # noqa: C901