Skip to content
This repository was archived by the owner on Jan 2, 2019. It is now read-only.

Commit 87539e5

Browse files
author
earthmant
committed
change state handling
1 parent cad31c4 commit 87539e5

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

cloudify_awssdk/ec2/resources/vpn_connection.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ def status(self):
6464
props = self.properties
6565
if not props:
6666
return None
67-
elif props and 'VgwTelemetry' not in props:
68-
return None
69-
return props['VgwTelemetry'][0].get('Status')
67+
return props.get('State')
7068

7169
def create(self, params):
7270
"""Create a new AWS EC2 VPN Connection."""
@@ -97,7 +95,9 @@ def prepare(ctx, resource_config, **_):
9795

9896

9997
@decorators.aws_resource(EC2VPNConnection, RESOURCE_TYPE)
100-
@decorators.wait_for_status(status_good=['UP'], status_pending=['DOWN'])
98+
@decorators.wait_for_status(
99+
status_good=['available'],
100+
status_pending=['pending'])
101101
def create(ctx, iface, resource_config, **_):
102102
"""Creates an AWS EC2 VPN Connection"""
103103
params = dict() if not resource_config else resource_config.copy()
@@ -119,7 +119,9 @@ def create(ctx, iface, resource_config, **_):
119119

120120

121121
@decorators.aws_resource(EC2VPNConnection, RESOURCE_TYPE)
122-
@decorators.wait_for_delete(status_deleted=['DOWN'], status_pending=['UP'])
122+
@decorators.wait_for_delete(
123+
status_deleted=['deleted'],
124+
status_pending=['available', 'deleting', 'pending'])
123125
def delete(ctx, iface, resource_config, **_):
124126
"""Deletes an AWS EC2 VPN Connection"""
125127
deleted_params = dict()

cloudify_awssdk/ec2/tests/test_vpn_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def test_class_status(self):
144144
self.vpn_connection.client = self.make_client_function(
145145
'describe_vpn_connections', return_value=response)
146146

147-
self.assertEqual(self.vpn_connection.status, 'status_test')
147+
self.assertEqual(self.vpn_connection.status, 'state_test')
148148

149149
def test_class_create(self):
150150
params = \

0 commit comments

Comments
 (0)