Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/azure-cli/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Release History

* Support cluster certificate rotation operation using "az aks rotate-certs".

**Packaging**

* Rewrite the az wrapper in python

**Profile**

* Polish error when using `az login -u {} -p {}` with Microsoft account
Expand Down
22 changes: 12 additions & 10 deletions src/azure-cli/az
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/usr/bin/env bash
#!/usr/bin/env python

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
import sys
import os

export PYTHONPATH="${DIR}/src:${PYTHONPATH}"
dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'src')

python -m azure.cli "$@"
if os.environ.get('PYTHONPATH') == None:
os.environ['PYTHONPATH'] = dir
else:
os.environ['PYTHONPATH'] = os.pathsep.join([
dir,
os.environ.get('PYTHONPATH'),
])

os.execl(sys.executable, sys.executable , '-m', 'azure.cli', *sys.argv[1:])