-
Notifications
You must be signed in to change notification settings - Fork 3.2k
{Packaging} Add warning message for Azure Linux 2.0 #31545
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
start_time = timeit.default_timer() | ||
|
||
import sys | ||
import os | ||
|
||
from azure.cli.core import telemetry | ||
from azure.cli.core import get_default_cli | ||
|
@@ -22,6 +23,14 @@ | |
|
||
logger = get_logger(__name__) | ||
|
||
AZURELINUX2_WARNING_MESSAGE = ( | ||
"Azure CLI 2.74.0 is the final version available on Azure Linux (Mariner) 2.0 and will not receive further " | ||
"updates. " | ||
"We recommend migrating to Azure Linux 3.0 to access newer versions of Azure CLI and continue receiving updates. " | ||
"For more information: https://go.microsoft.com/fwlink/?linkid=2322402. " | ||
"To disable this warning message, set AZURE_CLI_DISABLE_AZURELINUX2_WARNING environment variable to any value. " | ||
) | ||
|
||
|
||
def cli_main(cli, args): | ||
return cli.invoke(args) | ||
|
@@ -96,7 +105,6 @@ def cli_main(cli, args): | |
else: | ||
upgrade_exit_code = subprocess.call(cmd, shell=platform.system() == 'Windows') | ||
else: | ||
import os | ||
devnull = open(os.devnull, 'w') | ||
cmd.append('-y') | ||
upgrade_exit_code = subprocess.call(cmd, shell=platform.system() == 'Windows', stdout=devnull) | ||
|
@@ -115,6 +123,9 @@ def cli_main(cli, args): | |
except Exception as ex: # pylint: disable=broad-except | ||
logger.debug("Intercept survey prompt failed. %s", str(ex)) | ||
|
||
if 'AZURE_CLI_DISABLE_AZURELINUX2_WARNING' not in os.environ: | ||
logger.warning(AZURELINUX2_WARNING_MESSAGE) | ||
Comment on lines
+126
to
+127
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The warning can also be disabled by Introducing an environment variable Adding a config option |
||
|
||
telemetry.set_init_time_elapsed("{:.6f}".format(init_finish_time - start_time)) | ||
telemetry.set_invoke_time_elapsed("{:.6f}".format(invoke_finish_time - init_finish_time)) | ||
telemetry.conclude() |
Uh oh!
There was an error while loading. Please reload this page.