{"action":"created","comment":{"url":"https://api.github.com/repos/saltstack/salt/pulls/comments/90082404","pull_request_review_id":10607220,"id":90082404,"diff_hunk":"@@ -206,6 +207,7 @@ def is_ip(ip):\n     return is_ipv4(ip) or is_ipv6(ip)\n \n \n+@jinja_filter('is_ipv4')","path":"salt/utils/network.py","position":12,"original_position":12,"commit_id":"637d5bf3320db1fb605dec678ef087ce8eb086a3","original_commit_id":"637d5bf3320db1fb605dec678ef087ce8eb086a3","user":{"login":"mirceaulinic","id":16694679,"avatar_url":"https://avatars.githubusercontent.com/u/16694679?v=3","gravatar_id":"","url":"https://api.github.com/users/mirceaulinic","html_url":"https://github.com/mirceaulinic","followers_url":"https://api.github.com/users/mirceaulinic/followers","following_url":"https://api.github.com/users/mirceaulinic/following{/other_user}","gists_url":"https://api.github.com/users/mirceaulinic/gists{/gist_id}","starred_url":"https://api.github.com/users/mirceaulinic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirceaulinic/subscriptions","organizations_url":"https://api.github.com/users/mirceaulinic/orgs","repos_url":"https://api.github.com/users/mirceaulinic/repos","events_url":"https://api.github.com/users/mirceaulinic/events{/privacy}","received_events_url":"https://api.github.com/users/mirceaulinic/received_events","type":"User","site_admin":false},"body":"As a side note, please do not override the existing ```is_ipv4``` filter: https://github.com/saltstack/salt/blob/develop/salt/utils/templates.py#L354 which is using the ```is_ipv4_filter``` functions.","created_at":"2016-11-29T19:02:10Z","updated_at":"2016-11-29T19:02:10Z","html_url":"https://github.com/saltstack/salt/pull/37952#discussion_r90082404","pull_request_url":"https://api.github.com/repos/saltstack/salt/pulls/37952","_links":{"self":{"href":"https://api.github.com/repos/saltstack/salt/pulls/comments/90082404"},"html":{"href":"https://github.com/saltstack/salt/pull/37952#discussion_r90082404"},"pull_request":{"href":"https://api.github.com/repos/saltstack/salt/pulls/37952"}}},"pull_request":{"url":"https://api.github.com/repos/saltstack/salt/pulls/37952","id":95724531,"html_url":"https://github.com/saltstack/salt/pull/37952","diff_url":"https://github.com/saltstack/salt/pull/37952.diff","patch_url":"https://github.com/saltstack/salt/pull/37952.patch","issue_url":"https://api.github.com/repos/saltstack/salt/issues/37952","number":37952,"state":"open","locked":false,"title":"Adds an alternate implementation for a jinja filter decorator","user":{"login":"lorengordon","id":8457307,"avatar_url":"https://avatars.githubusercontent.com/u/8457307?v=3","gravatar_id":"","url":"https://api.github.com/users/lorengordon","html_url":"https://github.com/lorengordon","followers_url":"https://api.github.com/users/lorengordon/followers","following_url":"https://api.github.com/users/lorengordon/following{/other_user}","gists_url":"https://api.github.com/users/lorengordon/gists{/gist_id}","starred_url":"https://api.github.com/users/lorengordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorengordon/subscriptions","organizations_url":"https://api.github.com/users/lorengordon/orgs","repos_url":"https://api.github.com/users/lorengordon/repos","events_url":"https://api.github.com/users/lorengordon/events{/privacy}","received_events_url":"https://api.github.com/users/lorengordon/received_events","type":"User","site_admin":false},"body":"### What does this PR do?\r\n\r\nAdds a decorator, `@jinja_filter`, that will register the function as a jinja filter.\r\n\r\nThis PR represents an alternate approach to the decorator in PR #37808. In this PR, functions marked as jinja filters are added to a class attribute that maps the filter name to the function. The class attribute is then merged with the `jinja_env.filters` dictionary in `utils/templates.py`. This approach works for functions in both the execution and utils modules.\r\n\r\n### What issues does this PR fix or reference?\r\n\r\nFixes #37791\r\nRelated #28236\r\nRelated #37769\r\n\r\n### Tests written?\r\n\r\nNot yet, coming later after further discussion.\r\n","created_at":"2016-11-29T16:19:09Z","updated_at":"2016-11-29T19:08:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5bbee93d1a55951d344c4045ac89f576a673f2e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/saltstack/salt/pulls/37952/commits","review_comments_url":"https://api.github.com/repos/saltstack/salt/pulls/37952/comments","review_comment_url":"https://api.github.com/repos/saltstack/salt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/37952/comments","statuses_url":"https://api.github.com/repos/saltstack/salt/statuses/637d5bf3320db1fb605dec678ef087ce8eb086a3","head":{"label":"lorengordon:jinja-filter-decorator","ref":"jinja-filter-decorator","sha":"637d5bf3320db1fb605dec678ef087ce8eb086a3","user":{"login":"lorengordon","id":8457307,"avatar_url":"https://avatars.githubusercontent.com/u/8457307?v=3","gravatar_id":"","url":"https://api.github.com/users/lorengordon","html_url":"https://github.com/lorengordon","followers_url":"https://api.github.com/users/lorengordon/followers","following_url":"https://api.github.com/users/lorengordon/following{/other_user}","gists_url":"https://api.github.com/users/lorengordon/gists{/gist_id}","starred_url":"https://api.github.com/users/lorengordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorengordon/subscriptions","organizations_url":"https://api.github.com/users/lorengordon/orgs","repos_url":"https://api.github.com/users/lorengordon/repos","events_url":"https://api.github.com/users/lorengordon/events{/privacy}","received_events_url":"https://api.github.com/users/lorengordon/received_events","type":"User","site_admin":false},"repo":{"id":25579590,"name":"salt","full_name":"lorengordon/salt","owner":{"login":"lorengordon","id":8457307,"avatar_url":"https://avatars.githubusercontent.com/u/8457307?v=3","gravatar_id":"","url":"https://api.github.com/users/lorengordon","html_url":"https://github.com/lorengordon","followers_url":"https://api.github.com/users/lorengordon/followers","following_url":"https://api.github.com/users/lorengordon/following{/other_user}","gists_url":"https://api.github.com/users/lorengordon/gists{/gist_id}","starred_url":"https://api.github.com/users/lorengordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorengordon/subscriptions","organizations_url":"https://api.github.com/users/lorengordon/orgs","repos_url":"https://api.github.com/users/lorengordon/repos","events_url":"https://api.github.com/users/lorengordon/events{/privacy}","received_events_url":"https://api.github.com/users/lorengordon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lorengordon/salt","description":"Infrastructure automation and management system","fork":true,"url":"https://api.github.com/repos/lorengordon/salt","forks_url":"https://api.github.com/repos/lorengordon/salt/forks","keys_url":"https://api.github.com/repos/lorengordon/salt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lorengordon/salt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lorengordon/salt/teams","hooks_url":"https://api.github.com/repos/lorengordon/salt/hooks","issue_events_url":"https://api.github.com/repos/lorengordon/salt/issues/events{/number}","events_url":"https://api.github.com/repos/lorengordon/salt/events","assignees_url":"https://api.github.com/repos/lorengordon/salt/assignees{/user}","branches_url":"https://api.github.com/repos/lorengordon/salt/branches{/branch}","tags_url":"https://api.github.com/repos/lorengordon/salt/tags","blobs_url":"https://api.github.com/repos/lorengordon/salt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lorengordon/salt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lorengordon/salt/git/refs{/sha}","trees_url":"https://api.github.com/repos/lorengordon/salt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lorengordon/salt/statuses/{sha}","languages_url":"https://api.github.com/repos/lorengordon/salt/languages","stargazers_url":"https://api.github.com/repos/lorengordon/salt/stargazers","contributors_url":"https://api.github.com/repos/lorengordon/salt/contributors","subscribers_url":"https://api.github.com/repos/lorengordon/salt/subscribers","subscription_url":"https://api.github.com/repos/lorengordon/salt/subscription","commits_url":"https://api.github.com/repos/lorengordon/salt/commits{/sha}","git_commits_url":"https://api.github.com/repos/lorengordon/salt/git/commits{/sha}","comments_url":"https://api.github.com/repos/lorengordon/salt/comments{/number}","issue_comment_url":"https://api.github.com/repos/lorengordon/salt/issues/comments{/number}","contents_url":"https://api.github.com/repos/lorengordon/salt/contents/{+path}","compare_url":"https://api.github.com/repos/lorengordon/salt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lorengordon/salt/merges","archive_url":"https://api.github.com/repos/lorengordon/salt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lorengordon/salt/downloads","issues_url":"https://api.github.com/repos/lorengordon/salt/issues{/number}","pulls_url":"https://api.github.com/repos/lorengordon/salt/pulls{/number}","milestones_url":"https://api.github.com/repos/lorengordon/salt/milestones{/number}","notifications_url":"https://api.github.com/repos/lorengordon/salt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lorengordon/salt/labels{/name}","releases_url":"https://api.github.com/repos/lorengordon/salt/releases{/id}","deployments_url":"https://api.github.com/repos/lorengordon/salt/deployments","created_at":"2014-10-22T12:13:14Z","updated_at":"2016-03-02T14:29:28Z","pushed_at":"2016-11-29T15:01:19Z","git_url":"git://github.com/lorengordon/salt.git","ssh_url":"git@github.com:lorengordon/salt.git","clone_url":"https://github.com/lorengordon/salt.git","svn_url":"https://github.com/lorengordon/salt","homepage":"saltstack.com","size":152190,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"saltstack:develop","ref":"develop","sha":"c97bee2f40772bf89dde45a749d46b4c5b2e5dcf","user":{"login":"saltstack","id":1147473,"avatar_url":"https://avatars.githubusercontent.com/u/1147473?v=3","gravatar_id":"","url":"https://api.github.com/users/saltstack","html_url":"https://github.com/saltstack","followers_url":"https://api.github.com/users/saltstack/followers","following_url":"https://api.github.com/users/saltstack/following{/other_user}","gists_url":"https://api.github.com/users/saltstack/gists{/gist_id}","starred_url":"https://api.github.com/users/saltstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saltstack/subscriptions","organizations_url":"https://api.github.com/users/saltstack/orgs","repos_url":"https://api.github.com/users/saltstack/repos","events_url":"https://api.github.com/users/saltstack/events{/privacy}","received_events_url":"https://api.github.com/users/saltstack/received_events","type":"Organization","site_admin":false},"repo":{"id":1390248,"name":"salt","full_name":"saltstack/salt","owner":{"login":"saltstack","id":1147473,"avatar_url":"https://avatars.githubusercontent.com/u/1147473?v=3","gravatar_id":"","url":"https://api.github.com/users/saltstack","html_url":"https://github.com/saltstack","followers_url":"https://api.github.com/users/saltstack/followers","following_url":"https://api.github.com/users/saltstack/following{/other_user}","gists_url":"https://api.github.com/users/saltstack/gists{/gist_id}","starred_url":"https://api.github.com/users/saltstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saltstack/subscriptions","organizations_url":"https://api.github.com/users/saltstack/orgs","repos_url":"https://api.github.com/users/saltstack/repos","events_url":"https://api.github.com/users/saltstack/events{/privacy}","received_events_url":"https://api.github.com/users/saltstack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/saltstack/salt","description":"Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt Open software package repository here: ","fork":false,"url":"https://api.github.com/repos/saltstack/salt","forks_url":"https://api.github.com/repos/saltstack/salt/forks","keys_url":"https://api.github.com/repos/saltstack/salt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/saltstack/salt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/saltstack/salt/teams","hooks_url":"https://api.github.com/repos/saltstack/salt/hooks","issue_events_url":"https://api.github.com/repos/saltstack/salt/issues/events{/number}","events_url":"https://api.github.com/repos/saltstack/salt/events","assignees_url":"https://api.github.com/repos/saltstack/salt/assignees{/user}","branches_url":"https://api.github.com/repos/saltstack/salt/branches{/branch}","tags_url":"https://api.github.com/repos/saltstack/salt/tags","blobs_url":"https://api.github.com/repos/saltstack/salt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/saltstack/salt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/saltstack/salt/git/refs{/sha}","trees_url":"https://api.github.com/repos/saltstack/salt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/saltstack/salt/statuses/{sha}","languages_url":"https://api.github.com/repos/saltstack/salt/languages","stargazers_url":"https://api.github.com/repos/saltstack/salt/stargazers","contributors_url":"https://api.github.com/repos/saltstack/salt/contributors","subscribers_url":"https://api.github.com/repos/saltstack/salt/subscribers","subscription_url":"https://api.github.com/repos/saltstack/salt/subscription","commits_url":"https://api.github.com/repos/saltstack/salt/commits{/sha}","git_commits_url":"https://api.github.com/repos/saltstack/salt/git/commits{/sha}","comments_url":"https://api.github.com/repos/saltstack/salt/comments{/number}","issue_comment_url":"https://api.github.com/repos/saltstack/salt/issues/comments{/number}","contents_url":"https://api.github.com/repos/saltstack/salt/contents/{+path}","compare_url":"https://api.github.com/repos/saltstack/salt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/saltstack/salt/merges","archive_url":"https://api.github.com/repos/saltstack/salt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/saltstack/salt/downloads","issues_url":"https://api.github.com/repos/saltstack/salt/issues{/number}","pulls_url":"https://api.github.com/repos/saltstack/salt/pulls{/number}","milestones_url":"https://api.github.com/repos/saltstack/salt/milestones{/number}","notifications_url":"https://api.github.com/repos/saltstack/salt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/saltstack/salt/labels{/name}","releases_url":"https://api.github.com/repos/saltstack/salt/releases{/id}","deployments_url":"https://api.github.com/repos/saltstack/salt/deployments","created_at":"2011-02-20T20:16:56Z","updated_at":"2016-11-29T12:33:40Z","pushed_at":"2016-11-29T19:07:39Z","git_url":"git://github.com/saltstack/salt.git","ssh_url":"git@github.com:saltstack/salt.git","clone_url":"https://github.com/saltstack/salt.git","svn_url":"https://github.com/saltstack/salt","homepage":"https://repo.saltstack.com/","size":232477,"stargazers_count":7092,"watchers_count":7092,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3246,"mirror_url":null,"open_issues_count":4007,"forks":3246,"open_issues":4007,"watchers":7092,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/saltstack/salt/pulls/37952"},"html":{"href":"https://github.com/saltstack/salt/pull/37952"},"issue":{"href":"https://api.github.com/repos/saltstack/salt/issues/37952"},"comments":{"href":"https://api.github.com/repos/saltstack/salt/issues/37952/comments"},"review_comments":{"href":"https://api.github.com/repos/saltstack/salt/pulls/37952/comments"},"review_comment":{"href":"https://api.github.com/repos/saltstack/salt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/saltstack/salt/pulls/37952/commits"},"statuses":{"href":"https://api.github.com/repos/saltstack/salt/statuses/637d5bf3320db1fb605dec678ef087ce8eb086a3"}}}}
{"actor":{"display_login":"mirceaulinic"}}