Best Python code snippet using localstack_python
create.py
Source:create.py
1# Copyright (c) Microsoft Corporation.2# Licensed under the MIT license.3def create(deployment_path: str, **kwargs):4 # Late import.5 import yaml6 from maro.cli.grass.executors.grass_azure_executor import GrassAzureExecutor7 from maro.cli.grass.executors.grass_local_executor import GrassLocalExecutor8 from maro.cli.grass.executors.grass_on_premises_executor import GrassOnPremisesExecutor9 from maro.utils.exception.cli_exception import BadRequestError, FileOperationError, InvalidDeploymentTemplateError10 try:11 with open(deployment_path, "r") as fr:12 create_deployment = yaml.safe_load(fr)13 if create_deployment["mode"] == "grass/azure":14 GrassAzureExecutor.create(create_deployment=create_deployment)15 elif create_deployment["mode"] == "grass/on-premises":16 GrassOnPremisesExecutor.create(create_deployment=create_deployment)17 elif create_deployment["mode"] == "grass/local":18 executor = GrassLocalExecutor(cluster_name=create_deployment["name"], cluster_details=create_deployment)19 executor.create()20 else:21 raise BadRequestError(f"Unsupported operation in mode '{create_deployment['mode']}'.")22 except KeyError as e:23 raise InvalidDeploymentTemplateError(f"Missing key '{e.args[0]}'.")24 except FileNotFoundError:...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!