def do_cli(ctx, host, port, template, env_vars, debug_port, debug_args,  # pylint: disable=R0914
           debugger_path, docker_volume_basedir, docker_network, log_file, layer_cache_basedir, skip_pull_image,
           force_image_build, parameter_overrides):
    """
    Implementation of the ``cli`` method, just separated out for unit testing purposes
    """

    LOG.debug("local start_lambda command is called")

    # Pass all inputs to setup necessary context to invoke function locally.
    # Handler exception raised by the processor for invalid args and print errors

    try:
        with InvokeContext(template_file=template,
                           function_identifier=None,  # Don't scope to one particular function
                           env_vars_file=env_vars,
                           docker_volume_basedir=docker_volume_basedir,
                           docker_network=docker_network,
                           log_file=log_file,
                           skip_pull_image=skip_pull_image,
                           debug_port=debug_port,
                           debug_args=debug_args,
                           debugger_path=debugger_path,
                           parameter_overrides=parameter_overrides,
                           layer_cache_basedir=layer_cache_basedir,
                           force_image_build=force_image_build,
                           aws_region=ctx.region) as invoke_context:

            service = LocalLambdaService(lambda_invoke_context=invoke_context,
                                         port=port,
                                         host=host)
            service.start()

    except (InvalidSamDocumentException,
            OverridesNotWellDefinedError,
            InvalidLayerReference,
            DebuggingNotSupported) as ex:
        raise UserException(str(ex))
def do_cli ( ctx , host , port , template , env_vars , debug_port , debug_args , debugger_path , docker_volume_basedir , docker_network , log_file , layer_cache_basedir , skip_pull_image , force_image_build , parameter_overrides ) : LOG . debug ( "local start_lambda command is called" ) try : with InvokeContext ( template_file = template , function_identifier = None , env_vars_file = env_vars , docker_volume_basedir = docker_volume_basedir , docker_network = docker_network , log_file = log_file , skip_pull_image = skip_pull_image , debug_port = debug_port , debug_args = debug_args , debugger_path = debugger_path , parameter_overrides = parameter_overrides , layer_cache_basedir = layer_cache_basedir , force_image_build = force_image_build , aws_region = ctx . region ) as invoke_context : service = LocalLambdaService ( lambda_invoke_context = invoke_context , port = port , host = host ) service . start ( ) except ( InvalidSamDocumentException , OverridesNotWellDefinedError , InvalidLayerReference , DebuggingNotSupported ) as ex : raise UserException ( str ( ex ) )
Implementation of the ``cli`` method, just separated out for unit testing purposes