Azure / Azure/azure-cli

/usr/bin/az wrapper breaks when used as a symlink as of version 2.22.0

Open
#18,550 1 comment 2 reactions 1 assignee Claimed by @jiasli View on GitHub
act-platform-engineering-squad feature-request Installation
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62

**Describe the bug**

When the az command run by the user is a symlink to the actual /usr/bin/az, for example /usr/local/bin/az->/usr/bin/az, the az wrapper complains it cannot find the azure module.

**To Reproduce**

yum -y install azure-cli
ln -sf /usr/bin/az /usr/local/bin/az
/usr/local/bin/az --version
/usr/bin/python3: Error while finding module specification for 'azure.cli' (ModuleNotFoundError: No module named 'azure')

**Expected behavior**

azcli version output

**Environment summary**

yum, CentOS:7:latest, bash

**Additional context**

Introduced with https://github.com/Azure/azure-cli/commit/753a11c87575fedcc7425d4e34d332b17d8cd17b in the file scripts/release/rpm/azure-cli.spec

The removal of the hardcoded /usr/bin/python3 also has some implications for users running venvs as well.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.