{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/39595","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/39595/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/39595/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/39595/events","html_url":"https://github.com/ansible/ansible/pull/39595","id":319518398,"number":39595,"title":"Prevent pip module to fail if chdir is set without virtualenv","user":{"login":"mdellweg","id":25984076,"avatar_url":"https://avatars1.githubusercontent.com/u/25984076?v=4","gravatar_id":"","url":"https://api.github.com/users/mdellweg","html_url":"https://github.com/mdellweg","followers_url":"https://api.github.com/users/mdellweg/followers","following_url":"https://api.github.com/users/mdellweg/following{/other_user}","gists_url":"https://api.github.com/users/mdellweg/gists{/gist_id}","starred_url":"https://api.github.com/users/mdellweg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdellweg/subscriptions","organizations_url":"https://api.github.com/users/mdellweg/orgs","repos_url":"https://api.github.com/users/mdellweg/repos","events_url":"https://api.github.com/users/mdellweg/events{/privacy}","received_events_url":"https://api.github.com/users/mdellweg/received_events","type":"User","site_admin":false},"labels":[{"id":785271699,"url":"https://api.github.com/repos/ansible/ansible/labels/bug","name":"bug","color":"fbca04","default":true},{"id":496359346,"url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":61436281,"url":"https://api.github.com/repos/ansible/ansible/labels/needs_revision","name":"needs_revision","color":"eb6450","default":false},{"id":723150340,"url":"https://api.github.com/repos/ansible/ansible/labels/new_contributor","name":"new_contributor","color":"ededed","default":false},{"id":636352796,"url":"https://api.github.com/repos/ansible/ansible/labels/support:core","name":"support:core","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-02T11:42:12Z","updated_at":"2018-05-02T12:49:37Z","closed_at":"2018-05-02T12:49:37Z","author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/39595","html_url":"https://github.com/ansible/ansible/pull/39595","diff_url":"https://github.com/ansible/ansible/pull/39595.diff","patch_url":"https://github.com/ansible/ansible/pull/39595.patch"},"body":"##### SUMMARY\r\nIf chdir is set, but virtualenv is not, pip fails when trying to path.join them.\r\nThis is a trivial fix to prevent just this.\r\n\r\n##### ISSUE TYPE\r\n - Bugfix Pull Request\r\n\r\n##### COMPONENT NAME\r\npackgaging/languages/pip\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from \"ansible --version\" between quotes below -->\r\n```\r\nansible 2.5.2\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = [u'/home/<...>/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /usr/lib/python2.7/dist-packages/ansible\r\n  executable location = /usr/bin/ansible\r\n  python version = 2.7.15 (default, May  1 2018, 05:55:50) [GCC 7.3.0]\r\n```\r\n\r\n\r\n##### ADDITIONAL INFORMATION\r\ncommand:\r\n```\r\n$ ansible localhost -m pip -a \"chdir=/tmp/tilt name=pip\"\r\n```\r\nbefore:\r\n```\r\n [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'\r\n\r\nAn exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'startswith'\r\nlocalhost | FAILED! => {\r\n    \"changed\": false, \r\n    \"module_stderr\": \"Traceback (most recent call last):\\n  File \\\"/tmp/ansible_pj1nYB/ansible_module_pip.py\\\", line 562, in <module>\\n    main()\\n  File \\\"/tmp/ansible_pj1nYB/ansible_module_pip.py\\\", line 387, in main\\n    env = os.path.join(chdir, env)\\n  File \\\"/home/matthiasd/.virtualenvs/ansible/lib/python2.7/posixpath.py\\\", line 68, in join\\n    if b.startswith('/'):\\nAttributeError: 'NoneType' object has no attribute 'startswith'\\n\", \r\n    \"module_stdout\": \"\", \r\n    \"msg\": \"MODULE FAILURE\", \r\n    \"rc\": 1\r\n}\r\n```\r\nafter:\r\n```\r\n [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'\r\n\r\nlocalhost | SUCCESS => {\r\n    \"changed\": false, \r\n    \"cmd\": \"/home/matthiasd/.virtualenvs/ansible/bin/pip2 install pip\", \r\n    \"name\": [\r\n        \"pip\"\r\n    ], \r\n    \"requirements\": null, \r\n    \"state\": \"present\", \r\n    \"stderr\": \"\", \r\n    \"stderr_lines\": [], \r\n    \"stdout\": \"Requirement already satisfied: pip in /home/matthiasd/.virtualenvs/ansible/lib/python2.7/site-packages\\n\", \r\n    \"stdout_lines\": [\r\n        \"Requirement already satisfied: pip in /home/matthiasd/.virtualenvs/ansible/lib/python2.7/site-packages\"\r\n    ], \r\n    \"version\": null, \r\n    \"virtualenv\": null\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/385966295","html_url":"https://github.com/ansible/ansible/pull/39595#issuecomment-385966295","issue_url":"https://api.github.com/repos/ansible/ansible/issues/39595","id":385966295,"user":{"login":"Akasurde","id":633765,"avatar_url":"https://avatars1.githubusercontent.com/u/633765?v=4","gravatar_id":"","url":"https://api.github.com/users/Akasurde","html_url":"https://github.com/Akasurde","followers_url":"https://api.github.com/users/Akasurde/followers","following_url":"https://api.github.com/users/Akasurde/following{/other_user}","gists_url":"https://api.github.com/users/Akasurde/gists{/gist_id}","starred_url":"https://api.github.com/users/Akasurde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Akasurde/subscriptions","organizations_url":"https://api.github.com/users/Akasurde/orgs","repos_url":"https://api.github.com/users/Akasurde/repos","events_url":"https://api.github.com/users/Akasurde/events{/privacy}","received_events_url":"https://api.github.com/users/Akasurde/received_events","type":"User","site_admin":false},"created_at":"2018-05-02T12:49:37Z","updated_at":"2018-05-02T12:49:37Z","author_association":"MEMBER","body":"@mdellweg Thanks for reviews. "}}
{"actor":{"display_login":"Akasurde"}}