# Path: awscfncli2/runner/commands/command.py
# class Command(object):
#     SKIP_UPDATE_REFERENCES = False
# 
#     def __init__(self, pretty_printer, options):
#         assert isinstance(pretty_printer, StackPrettyPrinter)
#         self.ppt = pretty_printer
#         self.options = options
# 
#     def run(self, stack_context):
#         raise NotImplementedError
# 
# Path: awscfncli2/runner/commands/utils.py
# def is_stack_already_exists_exception(ex):
#     """Check whether given exception is "stack already exist"
#     Exception class is dynamiclly generated in botocore.
#     """
#     return ex.__class__.__name__ == 'AlreadyExistsException'


import uuid
from collections import namedtuple
from .command import Command
from .utils import is_stack_already_exists_exception
        self.ppt.pprint_stack_name(stack_context.stack_key,
                                   parameters['StackName'],
                                   'Deploying stack ')

        # create boto3 cfn resource
        cfn = session.resource('cloudformation')
        self.ppt.pprint_session(session)

        # packaging if necessary
        stack_context.run_packaging()

        # overwrite using cli parameters
        if self.options.on_failure is not None:
            parameters['OnFailure'] = self.options.on_failure
        if self.options.disable_rollback:
            parameters['DisableRollback'] = self.options.disable_rollback
        if self.options.timeout_in_minutes:
            parameters['TimeoutInMinutes'] = self.options.timeout_in_minutes

        self.ppt.pprint_parameters(parameters)

        # calling boto3...
        try:
            client_request_token = 'awscfncli-deploy-{}'.format(uuid.uuid1())
            stack = cfn.create_stack(
                ClientRequestToken=client_request_token,
                **parameters)
        except Exception as ex:
            # skip existing stack error
            if self.options.ignore_existing and \

# Path: awscfncli2/runner/commands/command.py
# class Command(object):
#     SKIP_UPDATE_REFERENCES = False
# 
#     def __init__(self, pretty_printer, options):
#         assert isinstance(pretty_printer, StackPrettyPrinter)
#         self.ppt = pretty_printer
#         self.options = options
# 
#     def run(self, stack_context):
#         raise NotImplementedError
# 
# Path: awscfncli2/runner/commands/utils.py
# def is_stack_already_exists_exception(ex):
#     """Check whether given exception is "stack already exist"
#     Exception class is dynamiclly generated in botocore.
#     """
#     return ex.__class__.__name__ == 'AlreadyExistsException'


# Path: awscfncli2/runner/commands/stack_deploy_command.py
import uuid
from collections import namedtuple
from .command import Command
from .utils import is_stack_already_exists_exception

        self.ppt.pprint_stack_name(stack_context.stack_key,
                                   parameters['StackName'],
                                   'Deploying stack ')

        # create boto3 cfn resource
        cfn = session.resource('cloudformation')
        self.ppt.pprint_session(session)

        # packaging if necessary
        stack_context.run_packaging()

        # overwrite using cli parameters
        if self.options.on_failure is not None:
            parameters['OnFailure'] = self.options.on_failure
        if self.options.disable_rollback:
            parameters['DisableRollback'] = self.options.disable_rollback
        if self.options.timeout_in_minutes:
            parameters['TimeoutInMinutes'] = self.options.timeout_in_minutes

        self.ppt.pprint_parameters(parameters)

        # calling boto3...
        try:
            client_request_token = 'awscfncli-deploy-{}'.format(uuid.uuid1())
            stack = cfn.create_stack(
                ClientRequestToken=client_request_token,
                **parameters)
        except Exception as ex:
            # skip existing stack error
            if self.options.ignore_existing and \

                    is_stack_already_exists_exception(ex):