From 2eb6a9ac8c76b5ce35e84a07b45d7cd4a3df6082 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 15 Nov 2016 13:57:28 -0800 Subject: [PATCH] [ACS] Fix bugs in download URLS (#1325) --- .../azure/cli/command_modules/acs/custom.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/custom.py b/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/custom.py index c48cb407aee..d9058f04cdc 100644 --- a/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/custom.py +++ b/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/custom.py @@ -80,13 +80,14 @@ def dcos_install_cli(install_location=None, client_version='1.8'): if not install_location: raise CLIError("No install location specified and it could not be determined from the current platform '{}'".format(system)) - + base_url = 'https://downloads.dcos.io/binaries/cli/{}/x86-64/dcos-{}/{}' if system == 'Windows': - file_url = 'https://downloads.dcos.io/binaries/cli/windows/x86-64/dcos-{}/dcos.exe'.format(client_version) + file_url = base_url.format('windows', client_version, 'dcos.exe') elif system == 'Linux': - file_url = 'https://downloads.dcos.io/binaries/cli/linux/x86-64/dcos-{}/dcos'.format(client_version) + # TODO Support ARM CPU here + file_url = base_url.format('linux', client_version, 'dcos') elif system == 'Darwin': - file_url = 'https://downloads.dcos.io/binaries/cli/darwin/x86-64/dcos-{}/dcos'.format(client_version) + file_url = base_url.format('darwin', client_version, 'dcos') else: raise CLIError('Proxy server ({}) does not exist on the cluster.'.format(system)) @@ -102,12 +103,14 @@ def k8s_install_cli(client_version="1.4.5", install_location=None): """ file_url = '' system = platform.system() + base_url = 'https://storage.googleapis.com/kubernetes-release/release/v{}/bin/{}/amd64/{}' if system == 'Windows': - file_url = 'https://storage.googleapis.com/kubernetes-release/release/v{}/bin/windows/amd64/kubectl.exe'.format(client_version) + file_url = base_url.format(client_version, 'windows', 'kubectl.exe') elif system == 'Linux': - file_url = 'https://storage.googleapis.com/kubernetes-release/release/v{}/bin/linux/amd64/kubectl'.format(client_version) + # TODO: Support ARM CPU here + file_url = base_url.format(client_version, 'linux', 'kubectl') elif system == 'Darwin': - file_url = 'https://storage.googleapis.com/kubernetes-release/release/v{}/darwin/amd64/kubectl'.format(client_version) + file_url = base_url.format(client_version, 'darwin', 'kubectl') else: raise CLIError('Proxy server ({}) does not exist on the cluster.'.format(system))