prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  ansible-lint called from Molecule fails when no Ansible-installed-with-pip is present
  # Issue Type
  
  - Bug report
  
  # Molecule and Ansible details
  
  ```
  # ansible --version
  ansible 2.2.1.0 (stable-2.2 acad2ba246) last updated 2016/12/11 20:27:02 (GMT +900)
    lib/ansible/modules/core: (detached HEAD 8139278530) last updated 2016/12/11 20:30:10 (GMT +900)
    lib/ansible/modules/extras: (detached HEAD f5f1fc934a) last updated 2016/12/11 20:30:10 (GMT +900)
    config file =
    configured module search path = Default w/o overrides
  # molecule --version
  molecule, version 1.16.1
  ```
  
  - Molecule installation method: pip
  - Ansible installation method: source
  
  # Desired Behaviour
  
  ```
  # molecule verify
  --> Executing ansible-lint...
  [ANSIBLE0002] Trailing whitespace
  playbook.yml:7
      - ansible-unix-python-environment
  ```
  
  # Actual Behaviour (Bug report only)
  
  ```
  # pip uninstall ansible
  ((( cut )))
    Successfully uninstalled ansible-2.2.0.0
  
  # . /usr/local/src/ansible/hacking/env-setup
  ((( cut )))
  PYTHONPATH=/usr/local/src/ansible/lib:
  ((( cut )))
  
  # ansible --version
  ansible 2.2.1.0 (stable-2.2 acad2ba246) last updated 2016/12/11 20:27:02 (GMT +900)
    lib/ansible/modules/core: (detached HEAD 8139278530) last updated 2016/12/11 20:30:10 (GMT +900)
    lib/ansible/modules/extras: (detached HEAD f5f1fc934a) last updated 2016/12/11 20:30:10 (GMT +900)
    config file =
    configured module search path = Default w/o overrides
  
  # molecule --debug verify
  --> Executing ansible-lint...
  DEBUG: COMMAND
  /usr/local/bin/ansible-lint playbook.yml --exclude .git --exclude .vagrant --exclude .molecule
  Traceback (most recent call last):
    File "/usr/local/bin/ansible-lint", line 30, in <module>
      import ansiblelint
    File "/usr/local/lib/python2.7/site-packages/ansiblelint/__init__.py", line 26, in <module>
      import ansiblelint.utils
    File "/usr/local/lib/python2.7/site-packages/ansiblelint/utils.py", line 25, in <module>
      import ansible.constants as C
  ImportError: No module named ansible.constants
  
  # /usr/local/bin/ansible-lint playbook.yml --exclude .git --exclude .vagrant --exclude .molecule
  [ANSIBLE0002] Trailing whitespace
  playbook.yml:7
      - ansible-unix-python-environment
  ```
  
  # Further tests
  
  With Ansible 2.2.0 installed with `pip` (regardless if the one from source configured or not; configured in the example below):
  
  ```
  # pip install ansible
  ((( cut )))
  Successfully installed ansible-2.2.0.0
  
  # . /usr/local/src/ansible/hacking/env-setup
  ((( cut )))
  
  # ansible --version
  ansible 2.2.1.0 (stable-2.2 acad2ba246) last updated 2016/12/11 20:27:02 (GMT +900)
    lib/ansible/modules/core: (detached HEAD 8139278530) last updated 2016/12/11 20:30:10 (GMT +900)
    lib/ansible/modules/extras: (detached HEAD f5f1fc934a) last updated 2016/12/11 20:30:10 (GMT +900)
    config file =
    configured module search path = Default w/o overrides
  
  # molecule verify
  --> Executing ansible-lint...
  [ANSIBLE0002] Trailing whitespace
  playbook.yml:7
      - ansible-unix-python-environment
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `molecule/verifier/ansible_lint.py`
  Content:
  ```
  1 #  Copyright (c) 2015-2016 Cisco Systems, Inc.
  2 #
  3 #  Permission is hereby granted, free of charge, to any person obtaining a copy
  4 #  of this software and associated documentation files (the "Software"), to
  5 #  deal in the Software without restriction, including without limitation the
  6 #  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  7 #  sell copies of the Software, and to permit persons to whom the Software is
  8 #  furnished to do so, subject to the following conditions:
  9 #
  10 #  The above copyright notice and this permission notice shall be included in
  11 #  all copies or substantial portions of the Software.
  12 #
  13 #  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14 #  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15 #  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16 #  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17 #  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  18 #  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  19 #  DEALINGS IN THE SOFTWARE.
  20 
  21 import os
  22 
  23 import sh
  24 
  25 from molecule import util
  26 from molecule.verifier import base
  27 
  28 
  29 class AnsibleLint(base.Base):
  30     """
  31     This is likely to be the source of issues.  The class was implemented to
  32     bring standardization to roles managed by molecule.  How we further refine
  33     this class, and its usage is up for discussion.
  34     """
  35 
  36     def __init__(self, molecule):
  37         super(AnsibleLint, self).__init__(molecule)
  38         self._playbook = molecule.config.config['ansible']['playbook']
  39         self._ignore_paths = molecule.config.config['molecule']['ignore_paths']
  40         self._debug = molecule.args.get('debug')
  41 
  42     def execute(self):
  43         """
  44         Executes ansible-lint against the configured playbook and returns
  45         None.
  46 
  47         :return: None
  48         """
  49         env = {
  50             'ANSIBLE_CONFIG':
  51             self._molecule.config.config['ansible']['config_file'],
  52             'HOME': os.environ.get('HOME')
  53         }
  54 
  55         if 'ansible_lint' not in self._molecule.disabled:
  56             msg = 'Executing ansible-lint...'
  57             util.print_info(msg)
  58             args = [self._playbook]
  59             [args.extend(["--exclude", path]) for path in self._ignore_paths]
  60             cmd = sh.ansible_lint.bake(
  61                 *args,
  62                 _env=env,
  63                 _out=util.callback_info,
  64                 _err=util.callback_error)
  65             util.run_command(cmd, debug=self._debug)
  66
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/molecule/verifier/ansible_lint.py b/molecule/verifier/ansible_lint.py
  --- a/molecule/verifier/ansible_lint.py
  +++ b/molecule/verifier/ansible_lint.py
  @@ -49,6 +49,7 @@
           env = {
               'ANSIBLE_CONFIG':
               self._molecule.config.config['ansible']['config_file'],
  +            'PYTHONPATH': os.environ.get('PYTHONPATH'),
               'HOME': os.environ.get('HOME')
           }
  
verification_info: {"golden_diff": "diff --git a/molecule/verifier/ansible_lint.py b/molecule/verifier/ansible_lint.py\n--- a/molecule/verifier/ansible_lint.py\n+++ b/molecule/verifier/ansible_lint.py\n@@ -49,6 +49,7 @@\n         env = {\n             'ANSIBLE_CONFIG':\n             self._molecule.config.config['ansible']['config_file'],\n+            'PYTHONPATH': os.environ.get('PYTHONPATH'),\n             'HOME': os.environ.get('HOME')\n         }\n", "issue": "ansible-lint called from Molecule fails when no Ansible-installed-with-pip is present\n# Issue Type\r\n\r\n- Bug report\r\n\r\n# Molecule and Ansible details\r\n\r\n```\r\n# ansible --version\r\nansible 2.2.1.0 (stable-2.2 acad2ba246) last updated 2016/12/11 20:27:02 (GMT +900)\r\n  lib/ansible/modules/core: (detached HEAD 8139278530) last updated 2016/12/11 20:30:10 (GMT +900)\r\n  lib/ansible/modules/extras: (detached HEAD f5f1fc934a) last updated 2016/12/11 20:30:10 (GMT +900)\r\n  config file =\r\n  configured module search path = Default w/o overrides\r\n# molecule --version\r\nmolecule, version 1.16.1\r\n```\r\n\r\n- Molecule installation method: pip\r\n- Ansible installation method: source\r\n\r\n# Desired Behaviour\r\n\r\n```\r\n# molecule verify\r\n--> Executing ansible-lint...\r\n[ANSIBLE0002] Trailing whitespace\r\nplaybook.yml:7\r\n    - ansible-unix-python-environment\r\n```\r\n\r\n# Actual Behaviour (Bug report only)\r\n\r\n```\r\n# pip uninstall ansible\r\n((( cut )))\r\n  Successfully uninstalled ansible-2.2.0.0\r\n\r\n# . /usr/local/src/ansible/hacking/env-setup\r\n((( cut )))\r\nPYTHONPATH=/usr/local/src/ansible/lib:\r\n((( cut )))\r\n\r\n# ansible --version\r\nansible 2.2.1.0 (stable-2.2 acad2ba246) last updated 2016/12/11 20:27:02 (GMT +900)\r\n  lib/ansible/modules/core: (detached HEAD 8139278530) last updated 2016/12/11 20:30:10 (GMT +900)\r\n  lib/ansible/modules/extras: (detached HEAD f5f1fc934a) last updated 2016/12/11 20:30:10 (GMT +900)\r\n  config file =\r\n  configured module search path = Default w/o overrides\r\n\r\n# molecule --debug verify\r\n--> Executing ansible-lint...\r\nDEBUG: COMMAND\r\n/usr/local/bin/ansible-lint playbook.yml --exclude .git --exclude .vagrant --exclude .molecule\r\nTraceback (most recent call last):\r\n  File \"/usr/local/bin/ansible-lint\", line 30, in <module>\r\n    import ansiblelint\r\n  File \"/usr/local/lib/python2.7/site-packages/ansiblelint/__init__.py\", line 26, in <module>\r\n    import ansiblelint.utils\r\n  File \"/usr/local/lib/python2.7/site-packages/ansiblelint/utils.py\", line 25, in <module>\r\n    import ansible.constants as C\r\nImportError: No module named ansible.constants\r\n\r\n# /usr/local/bin/ansible-lint playbook.yml --exclude .git --exclude .vagrant --exclude .molecule\r\n[ANSIBLE0002] Trailing whitespace\r\nplaybook.yml:7\r\n    - ansible-unix-python-environment\r\n```\r\n\r\n# Further tests\r\n\r\nWith Ansible 2.2.0 installed with `pip` (regardless if the one from source configured or not; configured in the example below):\r\n\r\n```\r\n# pip install ansible\r\n((( cut )))\r\nSuccessfully installed ansible-2.2.0.0\r\n\r\n# . /usr/local/src/ansible/hacking/env-setup\r\n((( cut )))\r\n\r\n# ansible --version\r\nansible 2.2.1.0 (stable-2.2 acad2ba246) last updated 2016/12/11 20:27:02 (GMT +900)\r\n  lib/ansible/modules/core: (detached HEAD 8139278530) last updated 2016/12/11 20:30:10 (GMT +900)\r\n  lib/ansible/modules/extras: (detached HEAD f5f1fc934a) last updated 2016/12/11 20:30:10 (GMT +900)\r\n  config file =\r\n  configured module search path = Default w/o overrides\r\n\r\n# molecule verify\r\n--> Executing ansible-lint...\r\n[ANSIBLE0002] Trailing whitespace\r\nplaybook.yml:7\r\n    - ansible-unix-python-environment\r\n```\n", "before_files": [{"content": "#  Copyright (c) 2015-2016 Cisco Systems, Inc.\n#\n#  Permission is hereby granted, free of charge, to any person obtaining a copy\n#  of this software and associated documentation files (the \"Software\"), to\n#  deal in the Software without restriction, including without limitation the\n#  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n#  sell copies of the Software, and to permit persons to whom the Software is\n#  furnished to do so, subject to the following conditions:\n#\n#  The above copyright notice and this permission notice shall be included in\n#  all copies or substantial portions of the Software.\n#\n#  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n#  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n#  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n#  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n#  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n#  DEALINGS IN THE SOFTWARE.\n\nimport os\n\nimport sh\n\nfrom molecule import util\nfrom molecule.verifier import base\n\n\nclass AnsibleLint(base.Base):\n    \"\"\"\n    This is likely to be the source of issues.  The class was implemented to\n    bring standardization to roles managed by molecule.  How we further refine\n    this class, and its usage is up for discussion.\n    \"\"\"\n\n    def __init__(self, molecule):\n        super(AnsibleLint, self).__init__(molecule)\n        self._playbook = molecule.config.config['ansible']['playbook']\n        self._ignore_paths = molecule.config.config['molecule']['ignore_paths']\n        self._debug = molecule.args.get('debug')\n\n    def execute(self):\n        \"\"\"\n        Executes ansible-lint against the configured playbook and returns\n        None.\n\n        :return: None\n        \"\"\"\n        env = {\n            'ANSIBLE_CONFIG':\n            self._molecule.config.config['ansible']['config_file'],\n            'HOME': os.environ.get('HOME')\n        }\n\n        if 'ansible_lint' not in self._molecule.disabled:\n            msg = 'Executing ansible-lint...'\n            util.print_info(msg)\n            args = [self._playbook]\n            [args.extend([\"--exclude\", path]) for path in self._ignore_paths]\n            cmd = sh.ansible_lint.bake(\n                *args,\n                _env=env,\n                _out=util.callback_info,\n                _err=util.callback_error)\n            util.run_command(cmd, debug=self._debug)\n", "path": "molecule/verifier/ansible_lint.py"}], "after_files": [{"content": "#  Copyright (c) 2015-2016 Cisco Systems, Inc.\n#\n#  Permission is hereby granted, free of charge, to any person obtaining a copy\n#  of this software and associated documentation files (the \"Software\"), to\n#  deal in the Software without restriction, including without limitation the\n#  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n#  sell copies of the Software, and to permit persons to whom the Software is\n#  furnished to do so, subject to the following conditions:\n#\n#  The above copyright notice and this permission notice shall be included in\n#  all copies or substantial portions of the Software.\n#\n#  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n#  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n#  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n#  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n#  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n#  DEALINGS IN THE SOFTWARE.\n\nimport os\n\nimport sh\n\nfrom molecule import util\nfrom molecule.verifier import base\n\n\nclass AnsibleLint(base.Base):\n    \"\"\"\n    This is likely to be the source of issues.  The class was implemented to\n    bring standardization to roles managed by molecule.  How we further refine\n    this class, and its usage is up for discussion.\n    \"\"\"\n\n    def __init__(self, molecule):\n        super(AnsibleLint, self).__init__(molecule)\n        self._playbook = molecule.config.config['ansible']['playbook']\n        self._ignore_paths = molecule.config.config['molecule']['ignore_paths']\n        self._debug = molecule.args.get('debug')\n\n    def execute(self):\n        \"\"\"\n        Executes ansible-lint against the configured playbook and returns\n        None.\n\n        :return: None\n        \"\"\"\n        env = {\n            'ANSIBLE_CONFIG':\n            self._molecule.config.config['ansible']['config_file'],\n            'PYTHONPATH': os.environ.get('PYTHONPATH'),\n            'HOME': os.environ.get('HOME')\n        }\n\n        if 'ansible_lint' not in self._molecule.disabled:\n            msg = 'Executing ansible-lint...'\n            util.print_info(msg)\n            args = [self._playbook]\n            [args.extend([\"--exclude\", path]) for path in self._ignore_paths]\n            cmd = sh.ansible_lint.bake(\n                *args,\n                _env=env,\n                _out=util.callback_info,\n                _err=util.callback_error)\n            util.run_command(cmd, debug=self._debug)\n", "path": "molecule/verifier/ansible_lint.py"}]}