Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
update acr and extension and batch-ai
  • Loading branch information
yugangw-msft committed Jan 18, 2018
commit e1c1ad070546375a35ae3c3c5fc85bc19e931cb7
3 changes: 3 additions & 0 deletions src/command_modules/azure-cli-acr/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Release History
===============
2.0.20
++++++
* minor fix

2.0.19
++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from knack.prompting import prompt, prompt_pass, NoTTYException
from knack.log import get_logger

from azure.cli.core.util import should_disable_connection_verify

from ._client_factory import cf_acr_registries
from ._constants import MANAGED_REGISTRY_SKU
from ._utils import get_registry_by_name
Expand All @@ -34,7 +36,7 @@ def _get_aad_token(cli_ctx, login_server, only_refresh_token, repository=None, p
"""
login_server = login_server.rstrip('/')

challenge = requests.get('https://' + login_server + '/v2/')
challenge = requests.get('https://' + login_server + '/v2/', verify=(not should_disable_connection_verify()))
if challenge.status_code not in [401] or 'WWW-Authenticate' not in challenge.headers:
raise CLIError("Registry '{}' did not issue a challenge.".format(login_server))

Expand Down Expand Up @@ -82,7 +84,8 @@ def _get_aad_token(cli_ctx, login_server, only_refresh_token, repository=None, p
'password': refresh
}

response = requests.post(authhost, urlencode(content), headers=headers)
response = requests.post(authhost, urlencode(content), headers=headers,
verify=(not should_disable_connection_verify()))

if response.status_code not in [200]:
raise CLIError(
Expand All @@ -106,7 +109,8 @@ def _get_aad_token(cli_ctx, login_server, only_refresh_token, repository=None, p
'scope': scope,
'refresh_token': refresh_token
}
response = requests.post(authhost, urlencode(content), headers=headers)
response = requests.post(authhost, urlencode(content), headers=headers,
verify=(not should_disable_connection_verify()))
access_token = loads(response.content.decode("utf-8"))["access_token"]

return access_token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from knack.util import CLIError
from knack.log import get_logger

from azure.cli.core.util import should_disable_connection_verify

from ._utils import validate_managed_registry
from ._docker_utils import get_access_credentials, log_registry_response

Expand Down Expand Up @@ -56,7 +58,8 @@ def _delete_data_from_registry(login_server, path, username, password, retry_tim
try:
response = requests.delete(
'https://{}{}'.format(login_server, path),
headers=_get_authorization_header(username, password)
headers=_get_authorization_header(username, password),
verify=(not should_disable_connection_verify())
)
log_registry_response(response)

Expand Down Expand Up @@ -84,7 +87,8 @@ def _get_manifest_digest(login_server, path, username, password, retry_times=3,
headers.update(_get_manifest_v2_header())
response = requests.get(
'https://{}{}'.format(login_server, path),
headers=headers
headers=headers,
verify=(not should_disable_connection_verify())
)
log_registry_response(response)

Expand Down Expand Up @@ -123,7 +127,8 @@ def _obtain_data_from_registry(login_server,
response = requests.get(
'https://{}{}'.format(login_server, path),
headers=_get_authorization_header(username, password),
params=_get_pagination_params(pagination)
params=_get_pagination_params(pagination),
verify=(not should_disable_connection_verify())
)
log_registry_response(response)

Expand Down
2 changes: 1 addition & 1 deletion src/command_modules/azure-cli-acr/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass = {}

VERSION = "2.0.19"
VERSION = "2.0.20"
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
Expand Down
3 changes: 3 additions & 0 deletions src/command_modules/azure-cli-batchai/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Release History
===============
0.1.5
++++++
* minor fixes

0.1.4
++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import azure.mgmt.batchai.models as models

from azure.cli.core.keys import is_valid_ssh_rsa_public_key
from azure.cli.core.util import should_disable_connection_verify


# Environment variables for specifying azure storage account and key. We want the user to make explicit
Expand Down Expand Up @@ -431,7 +432,8 @@ def tail_file(client, resource_group, job_name, directory, file_name):
# Stream the file
downloaded = 0
while True:
r = requests.get(url, headers={'Range': 'bytes={0}-'.format(downloaded)})
r = requests.get(url, headers={'Range': 'bytes={0}-'.format(downloaded)},
verify=(not should_disable_connection_verify()))
if int(r.status_code / 100) == 2:
downloaded += len(r.content)
print(r.content.decode(), end='')
Expand Down
2 changes: 1 addition & 1 deletion src/command_modules/azure-cli-batchai/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass = {}

VERSION = "0.1.4"
VERSION = "0.1.5"
# The full list of classifiers is available at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
CLASSIFIERS = [
Expand Down
3 changes: 3 additions & 0 deletions src/command_modules/azure-cli-extension/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Release History
===============
0.0.8
++++++
Minor fixes

0.0.7
++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@

# pylint: disable=inconsistent-return-statements
def get_index(index_url=None):
from azure.cli.core.util import should_disable_connection_verify
index_url = index_url or DEFAULT_INDEX_URL
try:
response = requests.get(index_url)
response = requests.get(index_url, verify=(not should_disable_connection_verify()))
if response.status_code == 200:
return response.json()
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ def _run_pip(pip_exec_args):


def _whl_download_from_url(url_parse_result, ext_file):
from azure.cli.core.util import should_disable_connection_verify
url = url_parse_result.geturl()
r = requests.get(url, stream=True)
r = requests.get(url, stream=True, verify=(not should_disable_connection_verify()))
if r.status_code != 200:
raise CLIError("Request to {} failed with {}".format(url, r.status_code))
with open(ext_file, 'wb') as f:
Expand Down
2 changes: 1 addition & 1 deletion src/command_modules/azure-cli-extension/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass = {}

VERSION = "0.0.7"
VERSION = "0.0.8"

CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
Expand Down