Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/azure-cli/azure/cli/command_modules/network/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -6998,6 +6998,7 @@ def create_vnet(cmd, resource_group_name, vnet_name, vnet_prefixes='10.0.0.0/16'
vnet.subnets = [Subnet(name=subnet_name,
address_prefix=subnet_prefix[0] if len(subnet_prefix) == 1 else None,
address_prefixes=subnet_prefix if len(subnet_prefix) > 1 else None,
private_endpoint_network_policies='Disabled',
network_security_group=NetworkSecurityGroup(id=network_security_group)
if network_security_group else None)]
else:
Expand Down Expand Up @@ -7119,7 +7120,7 @@ def create_subnet(cmd, resource_group_name, virtual_network_name, subnet_name,
if delegations:
subnet.delegations = delegations

if disable_private_endpoint_network_policies is True:
if disable_private_endpoint_network_policies is None or disable_private_endpoint_network_policies is True:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not change the function signature

disable_private_endpoint_network_policies=True,

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did some research, the reason why default argument "True" becomes "1", it's a kind of distinguishing:
https://github.com/microsoft/knack/blob/b4d9e66b469ef7c18a1f228f803505b7f550bdc1/knack/commands.py#L122-L124

subnet.private_endpoint_network_policies = "Disabled"
if disable_private_endpoint_network_policies is False:
subnet.private_endpoint_network_policies = "Enabled"
Expand Down

Large diffs are not rendered by default.

Loading