From 6c7f4eebe65712702bcf5608ae57edce946d8160 Mon Sep 17 00:00:00 2001 From: stas Date: Tue, 16 Feb 2021 10:17:01 -0800 Subject: [PATCH 1/2] adjust deployment warning handling to newer az cli --- cli/raft_sdk/raft_deploy.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cli/raft_sdk/raft_deploy.py b/cli/raft_sdk/raft_deploy.py index 02d58d03..1408e342 100644 --- a/cli/raft_sdk/raft_deploy.py +++ b/cli/raft_sdk/raft_deploy.py @@ -278,13 +278,15 @@ def init_app_insights(self): app_insights_installed = True if not app_insights_installed: - p = ("The installed extension" + p = [("The installed extension" " 'application-insights' is in preview.") + ("WARNING: The installed extension" + " 'application-insights' is in preview.)"] try: print('Installing application insights extension') az('extension add --name application-insights') except RaftAzCliException as ex: - if ex.error_message.strip() == p: + if ex.error_message.strip() is in p: pass else: raise ex @@ -929,7 +931,7 @@ def update_deployment_context(self): json.dump(defaults, d, indent=4) def test_az_version(self): - supported_versions = ['2.15.0', '2.16.0', '2.17.1'] + supported_versions = ['2.19.0', '2.19.1'] # az sometimes reports the version with an asterisk. # Perhaps when a new version of the CLI is available. tested_az_cli_versions = ( From 188c4bdac6cbf24ac784f6fef9763239ce926545 Mon Sep 17 00:00:00 2001 From: stas Date: Tue, 16 Feb 2021 10:26:01 -0800 Subject: [PATCH 2/2] Fix deployment failure caused by updated az-cli - AZ CLI prints "WARNING:" in front of the warning message now to std-out --- cli/raft_sdk/raft_deploy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/raft_sdk/raft_deploy.py b/cli/raft_sdk/raft_deploy.py index 1408e342..19af80c7 100644 --- a/cli/raft_sdk/raft_deploy.py +++ b/cli/raft_sdk/raft_deploy.py @@ -279,14 +279,14 @@ def init_app_insights(self): if not app_insights_installed: p = [("The installed extension" - " 'application-insights' is in preview.") + " 'application-insights' is in preview."), ("WARNING: The installed extension" - " 'application-insights' is in preview.)"] + " 'application-insights' is in preview.")] try: print('Installing application insights extension') az('extension add --name application-insights') except RaftAzCliException as ex: - if ex.error_message.strip() is in p: + if ex.error_message.strip() in p: pass else: raise ex