diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 6b3badf8067..49d906d2301 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -122,7 +122,7 @@ def get_distribution(): if platform.system() == 'Linux': try: distribution = platform.linux_distribution()[0].capitalize() - if not distribution and os.path.is_file('/etc/system-release'): + if not distribution and os.path.isfile('/etc/system-release'): distribution = platform.linux_distribution(supported_dists=['system'])[0].capitalize() if 'Amazon' in distribution: distribution = 'Amazon'