summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Davis <nitzmahone@users.noreply.github.com>2017-03-06 15:44:42 -0800
committerGitHub <noreply@github.com>2017-03-06 15:44:42 -0800
commitcbedc4a12a45bbd9c4c21db4a2a571a2a21f9700 (patch)
treee82eb5eedfe112be16c2b3bcb41aee20f284b761
parent96538ec15803744912f60d472c03b9049d3cb4a5 (diff)
downloadansible-cbedc4a12a45bbd9c4c21db4a2a571a2a21f9700.tar.gz
azure_rm inventory version comparison fix (#22341)
-rwxr-xr-xcontrib/inventory/azure_rm.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/inventory/azure_rm.py b/contrib/inventory/azure_rm.py
index a5119748dc..73b8b959d3 100755
--- a/contrib/inventory/azure_rm.py
+++ b/contrib/inventory/azure_rm.py
@@ -191,7 +191,7 @@ import os
import re
import sys
-from distutils.version import LooseVersion
+from packaging.version import Version
from os.path import expanduser
@@ -790,11 +790,11 @@ class AzureInventory(object):
def main():
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} "
- "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()