{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/27295","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/27295/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/27295/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/27295/events","html_url":"https://github.com/saltstack/salt/issues/27295","id":107691383,"number":27295,"title":"salt.modules.file.line documentation improvements","user":{"login":"JensRantil","id":730342,"avatar_url":"https://avatars.githubusercontent.com/u/730342?v=3","gravatar_id":"","url":"https://api.github.com/users/JensRantil","html_url":"https://github.com/JensRantil","followers_url":"https://api.github.com/users/JensRantil/followers","following_url":"https://api.github.com/users/JensRantil/following{/other_user}","gists_url":"https://api.github.com/users/JensRantil/gists{/gist_id}","starred_url":"https://api.github.com/users/JensRantil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JensRantil/subscriptions","organizations_url":"https://api.github.com/users/JensRantil/orgs","repos_url":"https://api.github.com/users/JensRantil/repos","events_url":"https://api.github.com/users/JensRantil/events{/privacy}","received_events_url":"https://api.github.com/users/JensRantil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Documentation","name":"Documentation","color":"fef2c0"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Execution%20Module","name":"Execution Module","color":"006b75"},{"url":"https://api.github.com/repos/saltstack/salt/labels/High%20Severity","name":"High Severity","color":"ff9143"},{"url":"https://api.github.com/repos/saltstack/salt/labels/P2","name":"P2","color":"155fb5"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestones/Approved","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars.githubusercontent.com/u/507599?v=3","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":3016,"closed_issues":3527,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2016-04-14T21:12:43Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2015-09-22T11:02:24Z","updated_at":"2016-04-15T10:57:43Z","closed_at":null,"body":"See https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.file.html#salt.modules.file.line.\r\n\r\n * Fix the `:param`. Nothing else in the documentation are using that format.\r\n * I have no idea what \"Match the target line for an action by a fragment of a string or regular expression.\" even means. There is no general description of `file.line`. I assume `match` will be required for every call to `file.line`? How do I decide whether I want to only match a fixed string fragment or regular expression?\r\n * what `before` and `after` actually are used for. Are they lines that need to be before or after? How do I choose if they should be regexps or not?\r\n * A lot of the parameters default to `None`. Which are required? Do they have any default values?\r\n * Use a better example that covers more cases."},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/210414414","html_url":"https://github.com/saltstack/salt/issues/27295#issuecomment-210414414","issue_url":"https://api.github.com/repos/saltstack/salt/issues/27295","id":210414414,"user":{"login":"campbellmc","id":8599847,"avatar_url":"https://avatars.githubusercontent.com/u/8599847?v=3","gravatar_id":"","url":"https://api.github.com/users/campbellmc","html_url":"https://github.com/campbellmc","followers_url":"https://api.github.com/users/campbellmc/followers","following_url":"https://api.github.com/users/campbellmc/following{/other_user}","gists_url":"https://api.github.com/users/campbellmc/gists{/gist_id}","starred_url":"https://api.github.com/users/campbellmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/campbellmc/subscriptions","organizations_url":"https://api.github.com/users/campbellmc/orgs","repos_url":"https://api.github.com/users/campbellmc/repos","events_url":"https://api.github.com/users/campbellmc/events{/privacy}","received_events_url":"https://api.github.com/users/campbellmc/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T10:57:43Z","updated_at":"2016-04-15T10:57:43Z","body":"On the subject of `file.line mode: Delete`, aside from having to use `content `rather than `match`...\r\n\r\nIt seems there is double escape processing for regex strings.\r\nThat is, with a single escape:\r\n`Rendering SLS 'base:blah' failed: found unknown escape character '.'; line xxx`\r\n\r\nThis means double escaping to obtain a literal period:\r\n\r\n `\\.` for a literal period must be `\\\\.`\r\n\r\nAs it's not standard regex escaping, although not uncommon when there is more than one string processor, it should be documented to save people a whole bunch of time."}}