|
3 | 3 |
|
4 | 4 | from dataclasses import dataclass, field
|
5 | 5 | from pathlib import PurePosixPath
|
6 |
| -from typing import Any, Dict, List, Type, cast |
| 6 | +from typing import Any, Dict, List, Optional, Type, Union, cast |
7 | 7 |
|
8 | 8 | from azure.mgmt.compute.models import GrantAccessData
|
9 | 9 | from dataclasses_json import dataclass_json
|
@@ -102,12 +102,15 @@ class VhdTransformerSchema(schema.Transformer):
|
102 | 102 | class DeployTransformerSchema(schema.Transformer):
|
103 | 103 | requirement: schema.Capability = field(default_factory=schema.Capability)
|
104 | 104 | resource_group_name: str = ""
|
| 105 | + deploy: bool = True |
105 | 106 |
|
106 | 107 |
|
107 | 108 | @dataclass_json
|
108 | 109 | @dataclass
|
109 | 110 | class DeleteTransformerSchema(schema.Transformer):
|
110 | 111 | resource_group_name: str = field(default="", metadata=field_metadata(required=True))
|
| 112 | + keep_environment: Optional[Union[str, bool]] = constants.ENVIRONMENT_KEEP_NO |
| 113 | + wait_delete: bool = True |
111 | 114 |
|
112 | 115 |
|
113 | 116 | class VhdTransformer(Transformer):
|
@@ -338,7 +341,7 @@ def _internal_run(self) -> Dict[str, Any]:
|
338 | 341 | assert environment
|
339 | 342 |
|
340 | 343 | platform.prepare_environment(environment=environment)
|
341 |
| - |
| 344 | + platform._azure_runbook.deploy = runbook.deploy |
342 | 345 | platform.deploy_environment(environment)
|
343 | 346 |
|
344 | 347 | resource_group_name = get_environment_context(environment).resource_group_name
|
@@ -385,6 +388,8 @@ def _internal_run(self) -> Dict[str, Any]:
|
385 | 388 | environment_context.resource_group_name = runbook.resource_group_name
|
386 | 389 | environment_context.resource_group_is_specified = True
|
387 | 390 |
|
| 391 | + platform.runbook.keep_environment = runbook.keep_environment |
| 392 | + platform._azure_runbook.wait_delete = runbook.wait_delete |
388 | 393 | platform.delete_environment(environment)
|
389 | 394 |
|
390 | 395 | return {}
|
|
0 commit comments