Skip to content

Commit b916cec

Browse files
committed
fix removing VM without sandbox
1 parent c6250ae commit b916cec

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

shell-definition.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
33
metadata:
44
template_name: VMware vCenter Cloud Provider Shell 2G
55
template_author: Quali
6-
template_version: 6.1.0
6+
template_version: 6.1.1
77
template_icon: shell-icon.png
88

99
description: >

src/driver.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,12 @@ def DeleteInstance(self, context: ResourceRemoteCommandContext, ports: list[str]
264264
resource_config = VCenterResourceConfig.from_context(context, api=api)
265265
resource = context.remote_endpoints[0]
266266
actions = VCenterDeployedVMActions.from_remote_resource(resource, api)
267-
reservation_info = ReservationInfo.from_remote_resource_context(context)
267+
try:
268+
reservation_info = ReservationInfo.from_remote_resource_context(context)
269+
except AttributeError:
270+
# The sandbox in which the app is deployed failed and was removed.
271+
# And the command was called not in the sandbox
272+
reservation_info = None
268273
delete_instance(actions.deployed_app, resource_config, reservation_info)
269274

270275
def SaveApp(

src/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
cloudshell-shell-core~=6.0
22
cloudshell-cp-core~=2.4
3-
cloudshell-cp-vcenter~=6.0
3+
cloudshell-cp-vcenter>=6.0.3,<7

0 commit comments

Comments
 (0)