From 909955f2e247280b639c0526d707f7357c02c481 Mon Sep 17 00:00:00 2001 From: Ruggero Marchei Date: Tue, 15 Jul 2014 18:04:46 +0200 Subject: [PATCH] fix get_distribution_version() on amazon linux --- lib/ansible/module_utils/basic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 252be82c28f..e08c817fe72 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -185,6 +185,8 @@ def get_distribution_version(): if platform.system() == 'Linux': try: distribution_version = platform.linux_distribution()[1] + if not distribution_version and os.path.isfile('/etc/system-release'): + distribution_version = platform.linux_distribution(supported_dists=['system'])[1] except: # FIXME: MethodMissing, I assume? distribution_version = platform.dist()[1]