Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing msrestazure library and methods from AZFW (Azure Firewall) #8225

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions src/azure-firewall/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Release History
===============
1.2.1
Copy link
Member

Choose a reason for hiding this comment

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

Pls update the version in setup.py

++++++
* Remove msrestazure dependency

1.2.0
++++++
* `network firewall policy rule-collection-group collection rule add/update"`: Add parameter `--http-headers-to-insert`
Expand Down
4 changes: 2 additions & 2 deletions src/azure-firewall/azext_firewall/_exception_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@


def exception_handler(ex):
from msrestazure.azure_exceptions import CloudError
if isinstance(ex, CloudError):
from azure.core.exceptions import HttpResponseError
if isinstance(ex, HttpResponseError):
text = getattr(ex.response, 'text', '')
if len(ex.args) == 1 and isinstance(ex.args[0], str):
ex.args = tuple([ex.args[0] + text])
Expand Down
14 changes: 7 additions & 7 deletions src/azure-firewall/azext_firewall/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def validate_application_rule_protocols(namespace):


def validate_ip_groups(cmd, namespace):
from msrestazure.tools import is_valid_resource_id, resource_id
from azure.mgmt.core.tools import is_valid_resource_id, resource_id

def _validate_name_or_id(ip_group, subscription):
# determine if public_ip_address is name or ID
Expand All @@ -46,7 +46,7 @@ def _validate_name_or_id(ip_group, subscription):
def get_public_ip_validator():
""" Retrieves a validator for public IP address. Accepting all defaults will perform a check
for an existing name or ID with no ARM-required -type parameter. """
from msrestazure.tools import is_valid_resource_id, resource_id
from azure.mgmt.core.tools import is_valid_resource_id, resource_id

def simple_validator(cmd, namespace):
if namespace.public_ip_address:
Expand All @@ -72,7 +72,7 @@ def _validate_name_or_id(public_ip):


def get_subnet_validator():
from msrestazure.tools import is_valid_resource_id, resource_id
from azure.mgmt.core.tools import is_valid_resource_id, resource_id

def simple_validator(cmd, namespace):
if namespace.virtual_network_name is None:
Expand All @@ -96,7 +96,7 @@ def simple_validator(cmd, namespace):


def get_management_subnet_validator():
from msrestazure.tools import is_valid_resource_id, resource_id
from azure.mgmt.core.tools import is_valid_resource_id, resource_id
from knack.util import CLIError

def simple_validator(cmd, namespace):
Expand Down Expand Up @@ -130,7 +130,7 @@ def simple_validator(cmd, namespace):
def get_management_public_ip_validator():
""" Retrieves a validator for public IP address. Accepting all defaults will perform a check
for an existing name or ID with no ARM-required -type parameter. """
from msrestazure.tools import is_valid_resource_id, resource_id
from azure.mgmt.core.tools import is_valid_resource_id, resource_id

def simple_validator(cmd, namespace):
if namespace.management_public_ip_address:
Expand All @@ -156,7 +156,7 @@ def _validate_name_or_id(public_ip):


def validate_firewall_policy(cmd, namespace):
from msrestazure.tools import is_valid_resource_id, resource_id
from azure.mgmt.core.tools import is_valid_resource_id, resource_id

if hasattr(namespace, 'base_policy') and namespace.base_policy is not None:
if not is_valid_resource_id(namespace.base_policy):
Expand All @@ -178,7 +178,7 @@ def validate_firewall_policy(cmd, namespace):


def validate_virtual_hub(cmd, namespace):
from msrestazure.tools import is_valid_resource_id, resource_id
from azure.mgmt.core.tools import is_valid_resource_id, resource_id

if hasattr(namespace, 'virtual_hub') and namespace.virtual_hub is not None:

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 @@ -13,7 +13,7 @@
from azure.cli.core.util import sdk_no_wait
from azure.cli.core.azclierror import UserFault, ServiceError, ValidationError, ArgumentUsageError
from azure.cli.core.commands.client_factory import get_subscription_id
from msrestazure.tools import resource_id
from azure.mgmt.core.tools import resource_id
from ._client_factory import network_client_factory
from .aaz.latest.network.firewall import Create as _AzureFirewallCreate, Update as _AzureFirewallUpdate, \
Show as _AzureFirewallShow
Expand Down
Loading