Skip to content
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

Fix azure cli version parsing #1295

Merged
merged 1 commit into from
Feb 11, 2025
Merged

Fix azure cli version parsing #1295

merged 1 commit into from
Feb 11, 2025

Conversation

jubittajohn
Copy link
Collaborator

@jubittajohn jubittajohn commented Feb 10, 2025

What this PR does

az --version 2>/dev/null | grep azure-cli |awk '{print $2}'

the above command which is used to retrieve the azure cli version also returns the keyword location in addition to the expected version, because the az --version also contains the keyword azure-cli in the path of the returned Python location.
Below is the output of the above command.

2.68.0
location

Output of the az --version command:

azure-cli                         2.68.0 *

core                              2.68.0 *
telemetry                          1.1.0

Dependencies:
msal                              1.31.1
azure-mgmt-resource               23.1.1

Python location '/opt/homebrew/Cellar/azure-cli/2.68.0/libexec/bin/python'

This change parses the version correctly

version returned affter this change:

> az version --query '"azure-cli"' -otsv
2.68.0

Jira:
Link to demo recording:

Special notes for your reviewer

@jubittajohn
Copy link
Collaborator Author

@microsoft-github-policy-service agree company="Red Hat"

@jubittajohn jubittajohn force-pushed the azure-cli-version-constraint branch 3 times, most recently from 7b06a91 to f63a436 Compare February 10, 2025 22:49
Copy link

Please rebase pull request.

@shitaljante
Copy link
Collaborator

I was blocked to deploy personal integrated dev env with error
Error: Error parsing version 'WARNING: You have 2 update(s) available. Consider updating your CLI installation with 'az upgrade' * '/opt/homebrew/Cellar/azure-cli/2.68.0/libexec/bin/python'' Invalid Semantic Version [15:10:05.122] ERROR: command failed { "err": "Error parsing version 'WARNING: You have 2 update(s) available. Consider updating your CLI installation with 'az upgrade'\n*\n'/opt/homebrew/Cellar/azure-cli/2.68.0/libexec/bin/python'' Invalid Semantic Version" } make: *** [hypershiftoperator.deploy_pipeline] Error 1

Tested these changes locally and its working now.

@jfchevrette
Copy link
Collaborator

Can you update the description to match the current proposed change? Thank you!

janboll
janboll previously approved these changes Feb 11, 2025
Copy link
Collaborator

@janboll janboll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Signed-off-by: jubittajohn <jujohn@redhat.com>
Co-authored-by: Jean-Francois Chevrette <jchevret@redhat.com>
@jubittajohn
Copy link
Collaborator Author

@janboll I have rebased this PR and updated the description. Could you help to re-approve the changes. Thank you

@janboll janboll merged commit 3b5deba into main Feb 11, 2025
20 checks passed
@janboll janboll deleted the azure-cli-version-constraint branch February 11, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants