{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/23714","labels_url":"https://api.github.com/repos/saltstack/salt/issues/23714/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/23714/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/23714/events","html_url":"https://github.com/saltstack/salt/issues/23714","id":76380493,"number":23714,"title":"file.copy force ignored during highstate, but not with 'salt-call state.sls_id'","user":{"login":"naemono","id":4429174,"avatar_url":"https://avatars.githubusercontent.com/u/4429174?v=3","gravatar_id":"","url":"https://api.github.com/users/naemono","html_url":"https://github.com/naemono","followers_url":"https://api.github.com/users/naemono/followers","following_url":"https://api.github.com/users/naemono/following{/other_user}","gists_url":"https://api.github.com/users/naemono/gists{/gist_id}","starred_url":"https://api.github.com/users/naemono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naemono/subscriptions","organizations_url":"https://api.github.com/users/naemono/orgs","repos_url":"https://api.github.com/users/naemono/repos","events_url":"https://api.github.com/users/naemono/events{/privacy}","received_events_url":"https://api.github.com/users/naemono/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Info%20Needed","name":"Info Needed","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/37","html_url":"https://github.com/saltstack/salt/milestones/Blocked","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/37/labels","id":343741,"number":37,"title":"Blocked","description":"Issues which are blocked in some way, whether they need further discussion, clarification, justification, or are blocked for some other reason.","creator":{"login":"basepi","id":702318,"avatar_url":"https://avatars.githubusercontent.com/u/702318?v=3","gravatar_id":"","url":"https://api.github.com/users/basepi","html_url":"https://github.com/basepi","followers_url":"https://api.github.com/users/basepi/followers","following_url":"https://api.github.com/users/basepi/following{/other_user}","gists_url":"https://api.github.com/users/basepi/gists{/gist_id}","starred_url":"https://api.github.com/users/basepi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basepi/subscriptions","organizations_url":"https://api.github.com/users/basepi/orgs","repos_url":"https://api.github.com/users/basepi/repos","events_url":"https://api.github.com/users/basepi/events{/privacy}","received_events_url":"https://api.github.com/users/basepi/received_events","type":"User","site_admin":false},"open_issues":233,"closed_issues":558,"state":"open","created_at":"2013-05-28T22:24:12Z","updated_at":"2015-05-20T05:09:10Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-05-14T14:43:22Z","updated_at":"2015-05-20T15:09:22Z","closed_at":null,"body":"During highstate, force is ignored:\r\n\r\n```\r\n     Comment: The target file \"/home/deploy/.env\" exists and will not be overwritten\r\n```\r\n\r\nState below\r\n\r\n```yaml\r\nbash_app_env:\r\n  file.managed:\r\n    - name: /home/deploy/.bash_app_env\r\n    - source: salt://application-base/autoscale-base/deployment-user/bash_app_env\r\n    - template: jinja\r\n    - user: deploy\r\n    - group: deploy\r\n    - mode: 0644\r\n\r\nformatappenv:\r\n  file.replace:\r\n    - name: /home/deploy/.bash_app_env\r\n    - pattern: '^\\s*$'\r\n    - repl: ''\r\n    - backup: False\r\n    - require:\r\n      - file: bash_app_env\r\n\r\nremoveblanklinesappenv:\r\n  cmd.run:\r\n    - name: \"sed -i.bak '/^$/d' /home/deploy/.bash_app_env\"\r\n    - user: deploy\r\n    - shell: /bin/bash\r\n    - require:\r\n      - file: formatappenv\r\n\r\ncreateENV:\r\n  file.copy:\r\n    - name: /home/deploy/.env\r\n    - source: /home/deploy/.bash_app_env\r\n    - user: deploy\r\n    - group: deploy\r\n    - force: True\r\n    - require:\r\n      - cmd: removeblanklinesappenv\r\n```\r\n\r\nBut run with 'salt-call state.sls_id', it functions as expected:\r\n\r\n```yaml\r\n     local:\r\n----------\r\n          ID: bash_app_env\r\n    Function: file.managed\r\n        Name: /home/deploy/.bash_app_env\r\n      Result: True\r\n     Comment: File /home/deploy/.bash_app_env updated\r\n     Started: 14:32:44.099434\r\n    Duration: 28.466 ms\r\n     Changes:\r\n\r\n          ID: formatappenv\r\n    Function: file.replace\r\n        Name: /home/deploy/.bash_app_env\r\n      Result: True\r\n     Comment: Changes were made\r\n     Started: 14:32:44.132742\r\n    Duration: 4.311 ms\r\n\r\n          ID: removeblanklinesappenv\r\n    Function: cmd.run\r\n        Name: sed -i.bak '/^$/d' /home/deploy/.bash_app_env\r\n      Result: True\r\n     Comment: Command \"sed -i.bak '/^$/d' /home/deploy/.bash_app_env\" run\r\n     Started: 14:32:44.140639\r\n    Duration: 126.497 ms\r\n     Changes:\r\n              ----------\r\n              pid:\r\n                  16113\r\n              retcode:\r\n                  0\r\n              stderr:\r\n              stdout:\r\n----------\r\n          ID: createENV\r\n    Function: file.copy\r\n        Name: /home/deploy/.env\r\n      Result: True\r\n     Comment: Copied \"/home/deploy/.bash_app_env\" to \"/home/deploy/.env\"\r\n     Started: 14:32:44.269203\r\n    Duration: 4.918 ms\r\n     Changes:\r\n              ----------\r\n              /home/deploy/.env:\r\n                  /home/deploy/.bash_app_env\r\n              group:\r\n                  deploy\r\n              user:\r\n                  deploy\r\n\r\nSummary\r\n------------\r\nSucceeded: 4 (changed=4)\r\nFailed:    0\r\n------------\r\nTotal states run:     4\r\n```\r\n\r\nVersions\r\n\r\n```yaml\r\ndeploy@prd-app-050521:~$ salt-call --versions-report\r\n                  Salt: 2015.5.0\r\n                Python: 2.7.6 (default, Mar 22 2014, 22:59:56)\r\n                Jinja2: 2.7.2\r\n              M2Crypto: 0.21.1\r\n        msgpack-python: 0.3.0\r\n          msgpack-pure: Not Installed\r\n              pycrypto: 2.6.1\r\n               libnacl: Not Installed\r\n                PyYAML: 3.10\r\n                 ioflo: Not Installed\r\n                 PyZMQ: 14.0.1\r\n                  RAET: Not Installed\r\n                   ZMQ: 4.0.4\r\n                  Mako: 0.9.1\r\n Debian source package: 2015.5.0+ds-1trusty1\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/103921116","html_url":"https://github.com/saltstack/salt/issues/23714#issuecomment-103921116","issue_url":"https://api.github.com/repos/saltstack/salt/issues/23714","id":103921116,"user":{"login":"rallytime","id":6547906,"avatar_url":"https://avatars.githubusercontent.com/u/6547906?v=3","gravatar_id":"","url":"https://api.github.com/users/rallytime","html_url":"https://github.com/rallytime","followers_url":"https://api.github.com/users/rallytime/followers","following_url":"https://api.github.com/users/rallytime/following{/other_user}","gists_url":"https://api.github.com/users/rallytime/gists{/gist_id}","starred_url":"https://api.github.com/users/rallytime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rallytime/subscriptions","organizations_url":"https://api.github.com/users/rallytime/orgs","repos_url":"https://api.github.com/users/rallytime/repos","events_url":"https://api.github.com/users/rallytime/events{/privacy}","received_events_url":"https://api.github.com/users/rallytime/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T15:09:22Z","updated_at":"2015-05-20T15:09:22Z","body":"Ok, that makes more sense. Thanks for the extra details!"}}