mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
azure_rm inventory version comparison fix (#22341)
This commit is contained in:
parent
96538ec158
commit
cbedc4a12a
1 changed files with 4 additions and 4 deletions
|
@ -191,7 +191,7 @@ import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from distutils.version import LooseVersion
|
from packaging.version import Version
|
||||||
|
|
||||||
from os.path import expanduser
|
from os.path import expanduser
|
||||||
|
|
||||||
|
@ -790,11 +790,11 @@ class AzureInventory(object):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if not HAS_AZURE:
|
if not HAS_AZURE:
|
||||||
sys.exit("The Azure python sdk is not installed (try 'pip install azure>=2.0.0rc5') - {0}".format(HAS_AZURE_EXC))
|
sys.exit("The Azure python sdk is not installed (try `pip install 'azure>=2.0.0rc5' --upgrade`) - {0}".format(HAS_AZURE_EXC))
|
||||||
|
|
||||||
if LooseVersion(azure_compute_version) < LooseVersion(AZURE_MIN_VERSION):
|
if Version(azure_compute_version) < Version(AZURE_MIN_VERSION):
|
||||||
sys.exit("Expecting azure.mgmt.compute.__version__ to be {0}. Found version {1} "
|
sys.exit("Expecting azure.mgmt.compute.__version__ to be {0}. Found version {1} "
|
||||||
"Do you have Azure >= 2.0.0rc5 installed?".format(AZURE_MIN_VERSION, azure_compute_version))
|
"Do you have Azure >= 2.0.0rc5 installed? (try `pip install 'azure>=2.0.0rc5' --upgrade`)".format(AZURE_MIN_VERSION, azure_compute_version))
|
||||||
|
|
||||||
AzureInventory()
|
AzureInventory()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue