Skip to content

Commit a50a7fc

Browse files
authored
register command group for security-policy waf (#8936)
* register command group for security-policy waf * fix pylint style check * modify _help.py instead of custom.py * remove redundant comments * fix style * fix linter * fix tests
1 parent e4e558d commit a50a7fc

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

src/alb/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Release History
44
===============
55

6+
2.0.1
7+
++++++
8+
* Register command group for security-policy waf and add description.
9+
610
2.0.0
711
++++++
812
* Upgrade API version to 2025-01-01, introducing Security Policy WAF.

src/alb/azext_alb/_help.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@
99
# pylint: disable=too-many-lines
1010

1111
from knack.help_files import helps # pylint: disable=unused-import
12+
13+
helps['network alb security-policy waf'] = """
14+
type: group
15+
short-summary: Manage and Configure WAF Security Policies for Application Gateway for Containers resource
16+
"""

src/alb/azext_alb/commands.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ def load_command_table(self, _): # pylint: disable=unused-argument
1515
self.command_table["network alb security-policy waf create"] = WafSecurityPolicyCreate(loader=self)
1616
self.command_table["network alb security-policy waf delete"] = WafSecurityPolicyDelete(loader=self)
1717
self.command_table["network alb security-policy waf update"] = WafSecurityPolicyUpdate(loader=self)
18+
19+
with self.command_group("network alb security-policy waf") as _:
20+
pass

src/alb/azext_alb/tests/latest/test_alb_commands.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
2222

2323
class AlbScenario(ScenarioTest):
24+
@live_only()
25+
@ResourceGroupPreparer(name_prefix='cli_record_test_tc_000999990', location="eastus2euap")
2426
def test_alb_resources(self):
2527
self.kwargs.update({
26-
'rg': 'cli_record_test_tc_000999990',
2728
'tc': 'tc1',
2829
'fe': 'fe1',
2930
'aso': 'a1',
@@ -32,10 +33,6 @@ def test_alb_resources(self):
3233
'waf_policy': 'waf_policy1',
3334
'sp_waf': 'sp_waf1',
3435
})
35-
36-
#Works with subscription 668f1741-ef48-4132-bf98-28b3a3d3f257
37-
# Create Resource group.
38-
self.cmd('group create -n {rg} --location eastus2euap')
3936

4037
# Create Traffic Controller
4138
tcCount1 = len(self.cmd('network alb list -g {rg}').get_output_in_json())

src/alb/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
# HISTORY.rst entry.
13-
VERSION = '2.0.0'
13+
VERSION = '2.0.1'
1414

1515
# The full list of classifiers is available at
1616
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)