Skip to content

Commit

Permalink
[Azure Firewall] Fix not found create_or_update in azure-firewall (Az…
Browse files Browse the repository at this point in the history
…ure#3505)

* fix not found create_or_update in azure-firewall

* Update setup.py

* Update HISTORY.rst
  • Loading branch information
00Kai0 authored Jun 15, 2021
1 parent 9b9f988 commit 0b720b3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/azure-firewall/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

0.11.0
++++++
* Fix issue: `create_or_update` not found

0.10.0
++++++
* `az network firewall create`: Add new parameter `--tier`
Expand Down
4 changes: 2 additions & 2 deletions src/azure-firewall/azext_firewall/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def delete_func(cmd, resource_group_name, resource_name, item_name, no_wait=Fals
[x for x in item.__getattribute__(prop) if x.name.lower() != item_name.lower()]
_set_param(item, prop, keep_items)
if no_wait:
sdk_no_wait(no_wait, client.create_or_update, resource_group_name, resource_name, item)
sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name, resource_name, item)
else:
result = sdk_no_wait(no_wait, client.create_or_update, resource_group_name, resource_name, item).result()
result = sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name, resource_name, item).result()
if next((x for x in getattr(result, prop) if x.name.lower() == item_name.lower()), None):
raise CLIError("Failed to delete '{}' on '{}'".format(item_name, resource_name))

Expand Down
2 changes: 1 addition & 1 deletion src/azure-firewall/azext_firewall/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def delete_func(cmd, resource_group_name, firewall_name, collection_name, item_n
af = client.get(resource_group_name, firewall_name)
collection = _find_item_at_path(af, '{}.{}'.format(collection_param_name, collection_name))
collection.rules = [rule for rule in collection.rules if rule.name != item_name]
client.create_or_update(resource_group_name, firewall_name, af)
client.begin_create_or_update(resource_group_name, firewall_name, af)

func_name = 'delete_af_{}'.format(item_param_name)
setattr(sys.modules[__name__], func_name, delete_func)
Expand Down
2 changes: 1 addition & 1 deletion src/azure-firewall/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.10.0"
VERSION = "0.11.0"

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

0 comments on commit 0b720b3

Please sign in to comment.