Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ matrix:
install:
# Install the code requirements
- mkdir $HOME/bin-black
- wget -O $HOME/bin-black/black https://github.com/python/black/releases/download/19.3b0/black
- wget -O $HOME/bin-black/black https://github.com/python/black/releases/download/19.10b0/black
- chmod +x $HOME/bin-black/black
- export PATH=$PATH:$HOME/bin-black
- black --version
Expand Down
2 changes: 1 addition & 1 deletion bin/sam-translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def transform_template(input_file_path, output_file_path):
with open(output_file_path, "w") as f:
f.write(cloud_formation_template_prettified)

print ("Wrote transformed CloudFormation template to: " + output_file_path)
print("Wrote transformed CloudFormation template to: " + output_file_path)
except InvalidDocumentException as e:
errorMessage = reduce(lambda message, error: message + " " + error.message, e.causes, e.message)
LOG.error(errorMessage)
Expand Down
13 changes: 10 additions & 3 deletions samtranslator/model/sam_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,16 @@ def to_cloudformation(self, **kwargs):
domain=self.Domain,
)

rest_api, deployment, stage, permissions, domain, basepath_mapping, route53, usage_plan_resources = api_generator.to_cloudformation(
redeploy_restapi_parameters
)
(
rest_api,
deployment,
stage,
permissions,
domain,
basepath_mapping,
route53,
usage_plan_resources,
) = api_generator.to_cloudformation(redeploy_restapi_parameters)

resources.extend([rest_api, deployment, stage])
resources.extend(permissions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_deployment_preference_with_codedeploy_predifined_configuration(self):
deployment_preference_collection.add(self.function_logical_id, {"Type": deployment_type})
deployment_group = deployment_preference_collection.deployment_group(self.function_logical_id)

print (deployment_group.DeploymentConfigName)
print(deployment_group.DeploymentConfigName)
self.assertEqual(expected_deployment_config_name, deployment_group.DeploymentConfigName)

@patch("boto3.session.Session.region_name", "ap-southeast-1")
Expand Down Expand Up @@ -133,7 +133,7 @@ def test_deployment_preference_with_conditional_custom_configuration(self):
deployment_preference_collection = DeploymentPreferenceCollection()
deployment_preference_collection.add(self.function_logical_id, {"Type": deployment_type})
deployment_group = deployment_preference_collection.deployment_group(self.function_logical_id)
print (deployment_group.DeploymentConfigName)
print(deployment_group.DeploymentConfigName)
self.assertEqual(expected_deployment_config_name, deployment_group.DeploymentConfigName)

@patch("boto3.session.Session.region_name", "ap-southeast-1")
Expand Down
2 changes: 1 addition & 1 deletion tests/translator/test_api_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_redeploy_implicit_api():
def translate_and_find_deployment_ids(manifest):
parameter_values = get_template_parameter_values()
output_fragment = transform(manifest, parameter_values, mock_policy_loader)
print (json.dumps(output_fragment, indent=2))
print(json.dumps(output_fragment, indent=2))

deployment_ids = set()
for key, value in output_fragment["Resources"].items():
Expand Down
12 changes: 6 additions & 6 deletions tests/translator/test_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def test_transform_success(self, testcase, partition_with_region):

output_fragment = transform(manifest, parameter_values, mock_policy_loader)

print (json.dumps(output_fragment, indent=2))
print(json.dumps(output_fragment, indent=2))

# Only update the deployment Logical Id hash in Py3.
if sys.version_info.major >= 3:
Expand Down Expand Up @@ -385,7 +385,7 @@ def test_transform_success_openapi3(self, testcase, partition_with_region):

output_fragment = transform(manifest, parameter_values, mock_policy_loader)

print (json.dumps(output_fragment, indent=2))
print(json.dumps(output_fragment, indent=2))

# Only update the deployment Logical Id hash in Py3.
if sys.version_info.major >= 3:
Expand Down Expand Up @@ -443,7 +443,7 @@ def test_transform_success_resource_policy(self, testcase, partition_with_region
}

output_fragment = transform(manifest, parameter_values, mock_policy_loader)
print (json.dumps(output_fragment, indent=2))
print(json.dumps(output_fragment, indent=2))

# Only update the deployment Logical Id hash in Py3.
if sys.version_info.major >= 3:
Expand Down Expand Up @@ -706,7 +706,7 @@ def test_swagger_body_sha_gets_recomputed():

output_fragment = transform(document, parameter_values, mock_policy_loader)

print (json.dumps(output_fragment, indent=2))
print(json.dumps(output_fragment, indent=2))
deployment_key = get_deployment_key(output_fragment)
assert deployment_key

Expand Down Expand Up @@ -742,7 +742,7 @@ def test_swagger_definitionuri_sha_gets_recomputed():

output_fragment = transform(document, parameter_values, mock_policy_loader)

print (json.dumps(output_fragment, indent=2))
print(json.dumps(output_fragment, indent=2))
deployment_key = get_deployment_key(output_fragment)
assert deployment_key

Expand Down Expand Up @@ -824,7 +824,7 @@ def _do_transform(self, document, parameter_values=get_template_parameter_values
mock_policy_loader = get_policy_mock()
output_fragment = transform(document, parameter_values, mock_policy_loader)

print (json.dumps(output_fragment, indent=2))
print(json.dumps(output_fragment, indent=2))

return output_fragment

Expand Down
4 changes: 2 additions & 2 deletions tests/translator/validator/test_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ def test_validate_template_success(testcase):
validation_errors = SamTemplateValidator.validate(manifest)
has_errors = len(validation_errors)
if has_errors:
print ("\nFailing template: {0}\n".format(testcase))
print (validation_errors)
print("\nFailing template: {0}\n".format(testcase))
print(validation_errors)
assert len(validation_errors) == 0