{"action":"closed","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/37939","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/37939/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/37939/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/37939/events","html_url":"https://github.com/saltstack/salt/issues/37939","id":192216649,"number":37939,"title":"file.comment always report changes in test=True mode","user":{"login":"Talkless","id":292191,"avatar_url":"https://avatars.githubusercontent.com/u/292191?v=3","gravatar_id":"","url":"https://api.github.com/users/Talkless","html_url":"https://github.com/Talkless","followers_url":"https://api.github.com/users/Talkless/followers","following_url":"https://api.github.com/users/Talkless/following{/other_user}","gists_url":"https://api.github.com/users/Talkless/gists{/gist_id}","starred_url":"https://api.github.com/users/Talkless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talkless/subscriptions","organizations_url":"https://api.github.com/users/Talkless/orgs","repos_url":"https://api.github.com/users/Talkless/repos","events_url":"https://api.github.com/users/Talkless/events{/privacy}","received_events_url":"https://api.github.com/users/Talkless/received_events","type":"User","site_admin":false},"labels":[{"id":41387723,"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":67287385,"url":"https://api.github.com/repos/saltstack/salt/labels/Core","name":"Core","color":"fef2c0","default":false},{"id":41389957,"url":"https://api.github.com/repos/saltstack/salt/labels/Fixed%20Pending%20Verification","name":"Fixed Pending Verification","color":"d4c5f9","default":false},{"id":41388135,"url":"https://api.github.com/repos/saltstack/salt/labels/High%20Severity","name":"High Severity","color":"ff9143","default":false},{"id":194766324,"url":"https://api.github.com/repos/saltstack/salt/labels/P4","name":"P4","color":"031a39","default":false},{"id":41387450,"url":"https://api.github.com/repos/saltstack/salt/labels/State%20Module","name":"State Module","color":"006b75","default":false}],"state":"closed","locked":false,"assignee":{"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},"assignees":[{"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}],"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/94","html_url":"https://github.com/saltstack/salt/milestones/Nitrogen%201","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/94/labels","id":2090709,"number":94,"title":"Nitrogen 1","description":"","creator":{"login":"meggiebot","id":12242451,"avatar_url":"https://avatars.githubusercontent.com/u/12242451?v=3","gravatar_id":"","url":"https://api.github.com/users/meggiebot","html_url":"https://github.com/meggiebot","followers_url":"https://api.github.com/users/meggiebot/followers","following_url":"https://api.github.com/users/meggiebot/following{/other_user}","gists_url":"https://api.github.com/users/meggiebot/gists{/gist_id}","starred_url":"https://api.github.com/users/meggiebot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meggiebot/subscriptions","organizations_url":"https://api.github.com/users/meggiebot/orgs","repos_url":"https://api.github.com/users/meggiebot/repos","events_url":"https://api.github.com/users/meggiebot/events{/privacy}","received_events_url":"https://api.github.com/users/meggiebot/received_events","type":"User","site_admin":false},"open_issues":34,"closed_issues":3,"state":"open","created_at":"2016-10-24T21:40:25Z","updated_at":"2016-12-02T06:50:31Z","due_on":"2016-12-16T00:00:00Z","closed_at":null},"comments":3,"created_at":"2016-11-29T08:24:14Z","updated_at":"2016-12-02T06:50:31Z","closed_at":"2016-12-02T06:50:30Z","body":"### Description of Issue/Question\r\n`file.comment` prints `File <some_file> is set to be updated` on every test=True run, although there is actually nothing to comment any more.\r\n\r\n### Setup\r\nState file `comment_test.sls`:\r\n```\r\n#disable default PostgreSQL configuration in munin-node conf file:\r\n\r\nmunin_node_postgresql_plugin_config_comment_a:\r\n    file.comment:\r\n        - name: /tmp/munin-node\r\n        - regex: |\r\n            \\[postgres_\\*\\]\r\n\r\n\r\nmunin_node_postgresql_plugin_config_comment_b:\r\n    file.comment:\r\n        - name: /tmp/munin-node\r\n        - regex: |\r\n            user postgres\r\n\r\n\r\nmunin_node_postgresql_plugin_config_comment_c:\r\n    file.comment:\r\n        - name: /tmp/munin-node\r\n        - regex: |\r\n            env\\.PGPORT.*\r\n\r\n\r\nmunin_node_postgresql_plugin_config_comment_d:\r\n    file.comment:\r\n        - name: /tmp/munin-node\r\n        - regex: |\r\n            env\\.PGUSER.*\r\n```\r\n\r\nAnd let's say we have file `/tmp/munin-node` with this content:\r\n```\r\n[postgres_*]\r\nuser postgres\r\nenv.PGUSER postgres\r\nenv.PGPORT 5432\r\n```\r\n### Steps to Reproduce Issue\r\n\r\n- Call `state.apply comment_test` to apply comments.\r\n- Check if lines are actually commented (they should be).\r\n- Call `state.apply comment_test test=True ` for test run. Prints `File /tmp/munin-node is set to be updated` (that's **NOT OK**).\r\n- Call `state.apply comment_test` to try apply comments again, but nothing actually happens with `Result: Clean` (and that's **OK**).\r\n\r\n\r\n### Versions Report\r\n(same versions and systems for master and minion)\r\n```\r\nSalt Version:\r\n           Salt: 2016.3.4\r\n \r\nDependency Versions:\r\n           cffi: 0.8.6\r\n       cherrypy: 3.5.0\r\n       dateutil: 2.2\r\n          gitdb: 0.5.4\r\n      gitpython: 0.3.2 RC1\r\n          ioflo: Not Installed\r\n         Jinja2: 2.7.3\r\n        libgit2: Not Installed\r\n        libnacl: Not Installed\r\n       M2Crypto: Not Installed\r\n           Mako: 1.0.0\r\n   msgpack-pure: Not Installed\r\n msgpack-python: 0.4.2\r\n   mysql-python: 1.2.3\r\n      pycparser: 2.10\r\n       pycrypto: 2.6.1\r\n         pygit2: Not Installed\r\n         Python: 2.7.9 (default, Jun 29 2016, 13:08:31)\r\n   python-gnupg: Not Installed\r\n         PyYAML: 3.11\r\n          PyZMQ: 14.4.0\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.5\r\n \r\nSystem Versions:\r\n           dist: debian 8.6 \r\n        machine: x86_64\r\n        release: 3.16.0-4-amd64\r\n         system: Linux\r\n        version: debian 8.6 \r\n ```"}}
{"actor":{"display_login":"Talkless"}}