Skip to content

Commit

Permalink
Issue/55 (#57)
Browse files Browse the repository at this point in the history
wrapping deploy in try / catch
  • Loading branch information
eamonnfaherty committed May 29, 2019
1 parent f0a9094 commit 2148f64
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
32 changes: 18 additions & 14 deletions servicecatalog_puppet/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import time
from threading import Thread
import traceback

import yaml
from betterboto import client as betterboto_client
Expand Down Expand Up @@ -563,7 +564,6 @@ def process_stream(stream_name, stream, parameters, puppet_account_id, deploymen
should_deploy = True

if provisioned_product_id:
# [{'Key': 'Path', 'Value': '/human-roles/'}, {'Key': 'RoleName', 'Value': 'DevOps'}]
with betterboto_client.CrossAccountClientContextManager(
'cloudformation', role, f"cfn-{account}-{region}", region_name=region
) as cloudformation:
Expand All @@ -583,19 +583,23 @@ def process_stream(stream_name, stream, parameters, puppet_account_id, deploymen
should_deploy = False

if should_deploy:
deploy_launch_to_account_and_region(
service_catalog,
launch,
account,
region,
product_id,
provisioning_artifact_id,
provisioned_product_name,
puppet_account_id,
path_id,
params,
launch.get('version'),
)
try:
deploy_launch_to_account_and_region(
service_catalog,
launch,
account,
region,
product_id,
provisioning_artifact_id,
provisioned_product_name,
puppet_account_id,
path_id,
params,
launch.get('version'),
)
except Exception as e:
logger.error(''.join(traceback.format_exception(None, e, e.__traceback__)))


logger.info('Finished creating stacks')

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setuptools.setup(
name="aws-service-catalog-puppet",
version="0.0.44",
version="0.0.45",
author="Eamonn Faherty",
author_email="aws-service-catalog-tools@amazon.com",
description="Making it easier to deploy ServiceCatalog products",
Expand Down

0 comments on commit 2148f64

Please sign in to comment.