Skip to content
Draft
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
27 changes: 7 additions & 20 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,34 @@
"configurations": [
{
"name": "Azure CLI Debug (Integrated Console)",
"type": "python",
"type": "debugpy",
"request": "launch",
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/src/azure-cli/azure/cli/__main__.py",
"cwd": "${workspaceRoot}",
"args": [
"--help"
"Version"
],
"console": "integratedTerminal",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
],
"justMyCode": false
},
{
"name": "Azure CLI Debug (External Console)",
"type": "python",
"type": "debugpy",
"request": "launch",
"stopOnEntry": true,
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/src/azure-cli/azure/cli/__main__.py",
"cwd": "${workspaceRoot}",
"args": [
"--help"
"VERSION"
],
"console": "externalTerminal",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit"
]
"justMyCode": false
},
{
"name": "Azdev Scripts",
"type": "python",
"type": "debugpy",
"request": "launch",
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/tools/automation/__main__.py",
Expand All @@ -47,11 +39,6 @@
"--help"
],
"console": "integratedTerminal",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
}
]
}
}
4 changes: 2 additions & 2 deletions src/azure-cli-core/azure/cli/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
import binascii
import getpass
import json
import yaml
import logging
import os
import platform
import re
import ssl
import sys
from urllib.request import urlopen

from knack.log import get_logger
from knack.util import CLIError, to_snake_case, to_camel_case
Expand Down Expand Up @@ -534,6 +532,7 @@ def get_file_json(file_path, throw_on_empty=True, preserve_order=False):


def get_file_yaml(file_path, throw_on_empty=True):
import yaml
content = read_file_content(file_path)
if not content:
if throw_on_empty:
Expand Down Expand Up @@ -1168,6 +1167,7 @@ def _ssl_context():


def urlretrieve(url):
from urllib.request import urlopen
req = urlopen(url, context=_ssl_context())
return req.read()

Expand Down
3 changes: 1 addition & 2 deletions src/azure-cli/azure/cli/command_modules/util/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def rest_call(cmd, url, method=None, headers=None, uri_parameters=None,

def show_version(cmd): # pylint: disable=unused-argument
from azure.cli.core.util import get_az_version_json
versions = get_az_version_json()
return versions
return get_az_version_json()


def upgrade_version(cmd, update_all=None, yes=None, allow_preview=None): # pylint: disable=too-many-locals, too-many-statements, too-many-branches, no-member, unused-argument
Expand Down
Loading