{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/33634","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/33634/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/33634/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/33634/events","html_url":"https://github.com/saltstack/salt/issues/33634","id":157664804,"number":33634,"title":" `no_chown` option is not working in pip.installed state","user":{"login":"itbabu","id":650691,"avatar_url":"https://avatars.githubusercontent.com/u/650691?v=3","gravatar_id":"","url":"https://api.github.com/users/itbabu","html_url":"https://github.com/itbabu","followers_url":"https://api.github.com/users/itbabu/followers","following_url":"https://api.github.com/users/itbabu/following{/other_user}","gists_url":"https://api.github.com/users/itbabu/gists{/gist_id}","starred_url":"https://api.github.com/users/itbabu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itbabu/subscriptions","organizations_url":"https://api.github.com/users/itbabu/orgs","repos_url":"https://api.github.com/users/itbabu/repos","events_url":"https://api.github.com/users/itbabu/events{/privacy}","received_events_url":"https://api.github.com/users/itbabu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-31T12:56:40Z","updated_at":"2016-06-01T18:55:58Z","closed_at":null,"body":"### Description\r\n\r\n `no_chown` option is ignored in  pip.installed state.\r\nThe state was working correctly before 2016.3.0 (Boron)\r\n\r\n### Setup\r\n\r\nSalt state\r\n```SALT\r\nvirtualenv_setup:\r\n   pip.installed:\r\n      - bin_env: /opt/penta/env/project\r\n      - user: penta\r\n      - requirements: /opt/penta/project/requirements.txt\r\n      - no_chown: True\r\n      - use_wheel: True\r\n```\r\n\r\n/opt/penta/project/requirements.txt contains\r\n```\r\n-r base.txt\r\nuWSGI==2.0.12\r\n```\r\n\r\n### Steps to Reproduce Issue\r\nRun the above state.\r\n```\r\n[INFO    ] Running state [virtualenv_setup] at time 14:06:42.334154\r\n[INFO    ] Executing state pip.installed for virtualenv_setup\r\n[INFO    ] Executing command '/opt/penta/env/project/bin/pip --version' in directory '/root'\r\n[DEBUG   ] output: pip 8.1.2 from /opt/penta/env/project/lib/python3.5/site-packages (python 3.5)\r\n[DEBUG   ] TREQ IS: None\r\n[INFO    ] _process_requirements from directory,None -- requirement: /opt/penta/project/requirements.txt\r\n[DEBUG   ] \r\n\tcwd: None -> /opt/penta/project\r\n\trequirement: /opt/penta/project/requirements.txt -> requirements.txt\r\n\r\n[INFO    ] _find_req -- link = requirements.txt\r\n[INFO    ] _find_req -- link = requirements/production.txt\r\n[INFO    ] _find_req -- link = requirements/base.txt\r\n[INFO    ] request files: ['requirements.txt', 'requirements/production.txt', 'requirements/base.txt']\r\n[DEBUG   ] TREQ N CWD: /tmp/tmpqIGOPF -- /opt/penta/project -- for requirements.txt\r\n[DEBUG   ] S: /opt/penta/project/requirements.txt\r\n[DEBUG   ] T: /tmp/tmpqIGOPF/requirements.txt\r\n[DEBUG   ] Copying /opt/penta/project/requirements.txt to /tmp/tmpqIGOPF/requirements.txt\r\n[DEBUG   ] Changing ownership of requirements file '/tmp/tmpqIGOPF/requirements.txt' to user 'penta'\r\n[DEBUG   ] TREQ N CWD: /tmp/tmpqIGOPF -- /opt/penta/project -- for production.txt\r\n[DEBUG   ] S: /opt/penta/project/production.txt\r\n[DEBUG   ] T: /tmp/tmpqIGOPF/production.txt\r\n[DEBUG   ] Copying /opt/penta/project/production.txt to /tmp/tmpqIGOPF/production.txt\r\n[ERROR   ] An exception occurred in this state: Traceback (most recent call last):\r\n  File \"/usr/lib/python2.7/dist-packages/salt/state.py\", line 1703, in call\r\n    **cdata['kwargs'])\r\n  File \"/usr/lib/python2.7/dist-packages/salt/loader.py\", line 1649, in wrapper\r\n    return f(*args, **kwargs)\r\n  File \"/usr/lib/python2.7/dist-packages/salt/states/pip_state.py\", line 728, in installed\r\n    trusted_host=trusted_host\r\n  File \"/usr/lib/python2.7/dist-packages/salt/modules/pip.py\", line 603, in install\r\n    user=user\r\n  File \"/usr/lib/python2.7/dist-packages/salt/modules/pip.py\", line 312, in _process_requirements\r\n    __salt__['file.copy'](source_path, target_path)\r\n  File \"/usr/lib/python2.7/dist-packages/salt/modules/file.py\", line 2890, in copy\r\n    raise CommandExecutionError('No such file or directory \\'{0}\\''.format(src))\r\nCommandExecutionError: No such file or directory '/opt/penta/project/production.txt'\r\n```\r\n\r\n### Versions Report\r\n\r\n2016.3.0 (Boron)     \r\n```\r\n     Dependency Versions:\r\n                 cffi: Not Installed\r\n             cherrypy: Not Installed\r\n             dateutil: 1.5\r\n                gitdb: 0.5.4\r\n            gitpython: 0.3.2 RC1\r\n                ioflo: Not Installed\r\n               Jinja2: 2.7.2\r\n              libgit2: Not Installed\r\n              libnacl: Not Installed\r\n             M2Crypto: Not Installed\r\n                 Mako: 0.9.1\r\n         msgpack-pure: Not Installed\r\n       msgpack-python: 0.3.0\r\n         mysql-python: 1.2.3\r\n            pycparser: Not Installed\r\n             pycrypto: 2.6.1\r\n               pygit2: Not Installed\r\n               Python: 2.7.6 (default, Jun 22 2015, 17:58:13)\r\n         python-gnupg: Not Installed\r\n               PyYAML: 3.10\r\n                PyZMQ: 14.0.1\r\n                 RAET: Not Installed\r\n                smmap: 0.8.2\r\n              timelib: Not Installed\r\n              Tornado: 4.2.1\r\n                  ZMQ: 4.0.4\r\n       \r\n      System Versions:\r\n                 dist: Ubuntu 14.04 trusty\r\n              machine: x86_64\r\n              release: 3.13.0-85-generic\r\n               system: Linux\r\n              version: Ubuntu 14.04 trusty\r\n```"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/223090645","html_url":"https://github.com/saltstack/salt/issues/33634#issuecomment-223090645","issue_url":"https://api.github.com/repos/saltstack/salt/issues/33634","id":223090645,"user":{"login":"Ch3LL","id":6886822,"avatar_url":"https://avatars.githubusercontent.com/u/6886822?v=3","gravatar_id":"","url":"https://api.github.com/users/Ch3LL","html_url":"https://github.com/Ch3LL","followers_url":"https://api.github.com/users/Ch3LL/followers","following_url":"https://api.github.com/users/Ch3LL/following{/other_user}","gists_url":"https://api.github.com/users/Ch3LL/gists{/gist_id}","starred_url":"https://api.github.com/users/Ch3LL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ch3LL/subscriptions","organizations_url":"https://api.github.com/users/Ch3LL/orgs","repos_url":"https://api.github.com/users/Ch3LL/repos","events_url":"https://api.github.com/users/Ch3LL/events{/privacy}","received_events_url":"https://api.github.com/users/Ch3LL/received_events","type":"User","site_admin":false},"created_at":"2016-06-01T18:55:58Z","updated_at":"2016-06-01T18:55:58Z","body":"@itbabu I am able to replicate this issue in 2016.3.0 with my sls file pasted below:\r\n\r\n```\r\nvirtualenv_setup:\r\n   pip.installed:\r\n      - user: ch3ll\r\n      - requirements: /tmp/test-pip/requirements.txt\r\n      - no_chown: True\r\n      - use_wheel: True\r\n```\r\n\r\nAnd I am seeing this in the logs: `[DEBUG   ] Changing ownership of requirements file '/tmp/tmpsHin3G/base.txt' to user 'ch3ll'`\r\n\r\n\r\nHere is the first bad commit (git bisect)\r\n\r\n```\r\n878def94fde9546dcfe9484d80d514bb7239cab1 is the first bad commit\r\ncommit 878def94fde9546dcfe9484d80d514bb7239cab1\r\nAuthor: Stephen D. Spencer <stephen@revsys.com>\r\nDate:   Sat Dec 26 21:30:27 2015 -0600\r\n\r\n    pip,requirements filej chain support + requirements list arg support\r\n    \r\n    modules.pip:\r\n     . `requirements` argument now properly supports requirements file\r\n     chaining by default--`no_chown` not required)\r\n     . `requirements` argument can be formed as a list\r\n     . `requirements` files can still be formed as a comma-delimited list\r\n     . both list structures support requirements file chaining\r\n    \r\n    states.virtualenv_mod:\r\n     . had to give states.virtualenv.managed() a little bit of attention to\r\n     provide a cwd argument for modules.pip.installed().  This is done via\r\n     os.path.dirname(os.path.abspath(requirements)) if a requirements\r\n     argument is present\r\n    \r\n     tests.integration.modules.pip:\r\n        . added:\r\n            test_requirements_as_list__sans_no_chown___absolute_file_path\r\n            test_requirements_as_list__sans_no_chown___non_absolute_file_path\r\n            test_chained_requirements__sans_no_chown___absolute_file_path\r\n            test_chained_requirements__sans_no_chown___non_absolute_file_path\r\n        . all tests passed before commit\r\n\r\n:040000 040000 65c5b578a848a5d0aeb59660fa2892e4cdc3f1ed 7dfef7f3a414f8de40cafd75be83f783872be230 M      salt\r\n:040000 040000 68ddd8d8c54227f41a8c1430066cb7e6176bd3f4 db5b2cd0a95f54ac6c50e15569a662d29b25001e M      tests\r\n```\r\n"}}
{"actor":{"display_login":"Ch3LL"}}