Skip to content

Commit

Permalink
Fixing pylint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
brownma-ms committed Feb 7, 2023
1 parent ee52f13 commit f94358e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
14 changes: 5 additions & 9 deletions sdk/ml/azure-ai-ml/azure/ai/ml/_azure_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
from typing import Dict, Optional

from azure.ai.ml._utils.utils import _get_mfe_url_override
from azure.ai.ml._utils._http_utils import HttpPipeline
from azure.ai.ml.constants._common import AZUREML_CLOUD_ENV_NAME
from azure.ai.ml.constants._common import ArmConstants
from azure.core.rest import HttpRequest
from azure.mgmt.core import ARMPipelineClient

from pprint import pformat



module_logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -100,7 +97,7 @@ def _get_cloud_details(cloud: str = AzureEnvironments.ENV_DEFAULT):

def _set_cloud(cloud: str = AzureEnvironments.ENV_DEFAULT):
"""Sets the current cloud
:param cloud: cloud name
"""
if cloud is not None:
Expand Down Expand Up @@ -216,13 +213,14 @@ def _get_registry_discovery_url(cloud, cloud_suffix=""):
"""Get or generate the registry discovery url
:param cloud: configuration of the cloud to get the registry_discovery_url from
:param cloud_suffix: the suffix to use for the cloud, in the case that the registry_discovery_url must be generated
:param cloud_suffix: the suffix to use for the cloud, in the case that the registry_discovery_url
must be generated
:return: string of discovery url
"""
cloud_name = cloud["name"]
if cloud_name in _environments:
return _environments[cloud_name].registry_url

registry_discovery_region = os.environ.get(
ArmConstants.REGISTRY_DISCOVERY_REGION_ENV_NAME,
ArmConstants.REGISTRY_DISCOVERY_DEFAULT_REGION
Expand All @@ -233,10 +231,8 @@ def _get_registry_discovery_url(cloud, cloud_suffix=""):
cloud_suffix
)
return os.environ.get(ArmConstants.REGISTRY_ENV_URL, registry_discovery_region_default)



def _get_clouds_by_metadata_url(metadata_url, timeout=ArmConstants.DEFAULT_TIMEOUT):
def _get_clouds_by_metadata_url(metadata_url):
"""Get all the clouds by the specified metadata url
:return: list of the clouds
Expand Down
1 change: 0 additions & 1 deletion sdk/ml/azure-ai-ml/azure/ai/ml/constants/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ class ArmConstants(object):
AZURE_MGMT_KEYVAULT_API_VERSION = "2019-09-01"
AZURE_MGMT_CONTAINER_REG_API_VERSION = "2019-05-01"

DEFAULT_TIMEOUT = 30
DEFAULT_URL = "https://management.azure.com/metadata/endpoints?api-version=2019-05-01"
METADATA_URL_ENV_NAME = "ARM_CLOUD_METADATA_URL"
REGISTRY_DISCOVERY_DEFAULT_REGION = "west"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import mock
import pytest
from mock import MagicMock, patch
import requests

from azure.ai.ml._azure_environments import (
AzureEnvironments,
Expand Down Expand Up @@ -113,7 +112,6 @@ def test_get_default_cloud(self):
with mock.patch("os.environ", {AZUREML_CLOUD_ENV_NAME: "yadadada"}):
cloud_name = _get_default_cloud_name()
assert cloud_name == "yadadada"


def test_get_registry_endpoint_from_public(self):
cloud_environment = AzureEnvironments.ENV_DEFAULT
Expand Down

0 comments on commit f94358e

Please sign in to comment.