From c31831f028c83c8b26661ec1da238efe12f49bbc Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Tue, 10 Feb 2015 14:41:15 -0800 Subject: [PATCH] Move from using inspect to __file__ in order to find the path to the module snippets --- v2/ansible/executor/module_common.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/v2/ansible/executor/module_common.py b/v2/ansible/executor/module_common.py index 594575e7895..9f878fb6b02 100644 --- a/v2/ansible/executor/module_common.py +++ b/v2/ansible/executor/module_common.py @@ -22,7 +22,6 @@ __metaclass__ = type # from python and deps from cStringIO import StringIO -import inspect import json import os import shlex @@ -43,11 +42,8 @@ REPLACER_VERSION = "\"<>\"" # specify an encoding for the python source file ENCODING_STRING = '# -*- coding: utf-8 -*-' -# TODO: Is there a reason we don't use __file__ here? -# Will this fail if ansible is run from an egg/wheel? Do we care? -_THIS_FILE = inspect.getfile(inspect.currentframe()) # we've moved the module_common relative to the snippets, so fix the path -_SNIPPET_PATH = os.path.join(os.path.dirname(this_file), '..', 'module_utils') +_SNIPPET_PATH = os.path.join(os.path.dirname(__file__), '..', 'module_utils') # ******************************************************************************