Skip to content

Commit

Permalink
fix ipsec_polices is NoneType (#3785)
Browse files Browse the repository at this point in the history
  • Loading branch information
00Kai0 authored Aug 18, 2021
1 parent 2a9e8fd commit bfe70b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/virtual-wan/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

0.2.8
++++++
* bugfix: `az network vpn-gateway connection ipsec-policy add ` ipsec_policies is NoneType.

0.2.7
++++++
* bugfix: `az network vhub get-effective-routes` always returns empty value list.
Expand Down
4 changes: 4 additions & 0 deletions src/virtual-wan/azext_vwan/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,9 @@ def add_vpn_gateway_connection_ipsec_policy(cmd, resource_group_name, gateway_na
client = network_client_factory(cmd.cli_ctx).vpn_gateways
gateway = client.get(resource_group_name, gateway_name)
conn = _find_item_at_path(gateway, 'connections.{}'.format(connection_name))

if conn.ipsec_policies is None:
conn.ipsec_policies = []
conn.ipsec_policies.append(
IpsecPolicy(
sa_life_time_seconds=sa_life_time_seconds,
Expand All @@ -600,6 +603,7 @@ def add_vpn_gateway_connection_ipsec_policy(cmd, resource_group_name, gateway_na
pfs_group=pfs_group
)
)

_upsert(gateway, 'connections', conn, 'name', warn=False)
poller = sdk_no_wait(no_wait, client.create_or_update,
resource_group_name, gateway_name, gateway)
Expand Down
2 changes: 1 addition & 1 deletion src/virtual-wan/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from codecs import open
from setuptools import setup, find_packages

VERSION = "0.2.7"
VERSION = "0.2.8"

CLASSIFIERS = [
'Development Status :: 4 - Beta',
Expand Down

0 comments on commit bfe70b4

Please sign in to comment.