{"action":"created","comment":{"url":"https://api.github.com/repos/napalm-automation/napalm/pulls/comments/151423626","pull_request_review_id":77127797,"id":151423626,"diff_hunk":"@@ -61,8 +61,9 @@ def load_template(cls, template_name, template_source=None, template_path=None,\n             loader = jinja2.FileSystemLoader(search_path)\n             environment = jinja2.Environment(loader=loader)\n \n-            for filter_name, filter_function in CustomJinjaFilters.filters().items():\n-                environment.filters[filter_name] = filter_function\n+            for d in [CustomJinjaFilters.filters(), jinja_filters]:","path":"napalm/base/helpers.py","position":15,"original_position":15,"commit_id":"7754fefafe5cca56b5f1764662925c0dba15ed9e","original_commit_id":"7754fefafe5cca56b5f1764662925c0dba15ed9e","user":{"login":"bewing","id":4759896,"avatar_url":"https://avatars3.githubusercontent.com/u/4759896?v=4","gravatar_id":"","url":"https://api.github.com/users/bewing","html_url":"https://github.com/bewing","followers_url":"https://api.github.com/users/bewing/followers","following_url":"https://api.github.com/users/bewing/following{/other_user}","gists_url":"https://api.github.com/users/bewing/gists{/gist_id}","starred_url":"https://api.github.com/users/bewing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bewing/subscriptions","organizations_url":"https://api.github.com/users/bewing/orgs","repos_url":"https://api.github.com/users/bewing/repos","events_url":"https://api.github.com/users/bewing/events{/privacy}","received_events_url":"https://api.github.com/users/bewing/received_events","type":"User","site_admin":false},"body":"Maybe `for filter_name, filter_function in itertools.chain(CustonJinjaFilters.filters().items(), jinja_filters.items()):` ?","created_at":"2017-11-16T14:15:41Z","updated_at":"2017-11-16T14:15:41Z","html_url":"https://github.com/napalm-automation/napalm/pull/522#discussion_r151423626","pull_request_url":"https://api.github.com/repos/napalm-automation/napalm/pulls/522","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/napalm-automation/napalm/pulls/comments/151423626"},"html":{"href":"https://github.com/napalm-automation/napalm/pull/522#discussion_r151423626"},"pull_request":{"href":"https://api.github.com/repos/napalm-automation/napalm/pulls/522"}}},"pull_request":{"url":"https://api.github.com/repos/napalm-automation/napalm/pulls/522","id":152880345,"html_url":"https://github.com/napalm-automation/napalm/pull/522","diff_url":"https://github.com/napalm-automation/napalm/pull/522.diff","patch_url":"https://github.com/napalm-automation/napalm/pull/522.patch","issue_url":"https://api.github.com/repos/napalm-automation/napalm/issues/522","number":522,"state":"open","locked":false,"title":"base: helpers: Added jinja_filters arg to load_template","user":{"login":"nickethier","id":766500,"avatar_url":"https://avatars0.githubusercontent.com/u/766500?v=4","gravatar_id":"","url":"https://api.github.com/users/nickethier","html_url":"https://github.com/nickethier","followers_url":"https://api.github.com/users/nickethier/followers","following_url":"https://api.github.com/users/nickethier/following{/other_user}","gists_url":"https://api.github.com/users/nickethier/gists{/gist_id}","starred_url":"https://api.github.com/users/nickethier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickethier/subscriptions","organizations_url":"https://api.github.com/users/nickethier/orgs","repos_url":"https://api.github.com/users/nickethier/repos","events_url":"https://api.github.com/users/nickethier/events{/privacy}","received_events_url":"https://api.github.com/users/nickethier/received_events","type":"User","site_admin":false},"body":"This is a bit more of a discussion with working code, but happy to have it merged if it checks out.\r\n\r\nIn the ios driver I want to implement the set_users template, but I would need to either compute each ssh key's fingerprint, or wrap the text since ios doesn't allow any lines longer than 254. Adding a filter to the base class seemed like the wrong solution, so I came up with this. This way the ios driver could override `base.load_template` and inject the filters specific to the driver. ","created_at":"2017-11-15T20:44:19Z","updated_at":"2017-11-16T14:15:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9765a015abb31de3bc9105dbf962bdc446004874","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/napalm-automation/napalm/milestones/11","html_url":"https://github.com/napalm-automation/napalm/milestone/11","labels_url":"https://api.github.com/repos/napalm-automation/napalm/milestones/11/labels","id":2861686,"number":11,"title":"DISCUSSION","description":null,"creator":{"login":"mirceaulinic","id":16694679,"avatar_url":"https://avatars1.githubusercontent.com/u/16694679?v=4","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},"open_issues":20,"closed_issues":0,"state":"open","created_at":"2017-10-24T08:57:09Z","updated_at":"2017-11-16T10:49:16Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/napalm-automation/napalm/pulls/522/commits","review_comments_url":"https://api.github.com/repos/napalm-automation/napalm/pulls/522/comments","review_comment_url":"https://api.github.com/repos/napalm-automation/napalm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/napalm-automation/napalm/issues/522/comments","statuses_url":"https://api.github.com/repos/napalm-automation/napalm/statuses/7754fefafe5cca56b5f1764662925c0dba15ed9e","head":{"label":"nickethier:feature/custom_jinja_filters","ref":"feature/custom_jinja_filters","sha":"7754fefafe5cca56b5f1764662925c0dba15ed9e","user":{"login":"nickethier","id":766500,"avatar_url":"https://avatars0.githubusercontent.com/u/766500?v=4","gravatar_id":"","url":"https://api.github.com/users/nickethier","html_url":"https://github.com/nickethier","followers_url":"https://api.github.com/users/nickethier/followers","following_url":"https://api.github.com/users/nickethier/following{/other_user}","gists_url":"https://api.github.com/users/nickethier/gists{/gist_id}","starred_url":"https://api.github.com/users/nickethier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickethier/subscriptions","organizations_url":"https://api.github.com/users/nickethier/orgs","repos_url":"https://api.github.com/users/nickethier/repos","events_url":"https://api.github.com/users/nickethier/events{/privacy}","received_events_url":"https://api.github.com/users/nickethier/received_events","type":"User","site_admin":false},"repo":{"id":109458871,"name":"napalm","full_name":"nickethier/napalm","owner":{"login":"nickethier","id":766500,"avatar_url":"https://avatars0.githubusercontent.com/u/766500?v=4","gravatar_id":"","url":"https://api.github.com/users/nickethier","html_url":"https://github.com/nickethier","followers_url":"https://api.github.com/users/nickethier/followers","following_url":"https://api.github.com/users/nickethier/following{/other_user}","gists_url":"https://api.github.com/users/nickethier/gists{/gist_id}","starred_url":"https://api.github.com/users/nickethier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickethier/subscriptions","organizations_url":"https://api.github.com/users/nickethier/orgs","repos_url":"https://api.github.com/users/nickethier/repos","events_url":"https://api.github.com/users/nickethier/events{/privacy}","received_events_url":"https://api.github.com/users/nickethier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nickethier/napalm","description":"Network Automation and Programmability Abstraction Layer with Multivendor support","fork":true,"url":"https://api.github.com/repos/nickethier/napalm","forks_url":"https://api.github.com/repos/nickethier/napalm/forks","keys_url":"https://api.github.com/repos/nickethier/napalm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nickethier/napalm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nickethier/napalm/teams","hooks_url":"https://api.github.com/repos/nickethier/napalm/hooks","issue_events_url":"https://api.github.com/repos/nickethier/napalm/issues/events{/number}","events_url":"https://api.github.com/repos/nickethier/napalm/events","assignees_url":"https://api.github.com/repos/nickethier/napalm/assignees{/user}","branches_url":"https://api.github.com/repos/nickethier/napalm/branches{/branch}","tags_url":"https://api.github.com/repos/nickethier/napalm/tags","blobs_url":"https://api.github.com/repos/nickethier/napalm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nickethier/napalm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nickethier/napalm/git/refs{/sha}","trees_url":"https://api.github.com/repos/nickethier/napalm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nickethier/napalm/statuses/{sha}","languages_url":"https://api.github.com/repos/nickethier/napalm/languages","stargazers_url":"https://api.github.com/repos/nickethier/napalm/stargazers","contributors_url":"https://api.github.com/repos/nickethier/napalm/contributors","subscribers_url":"https://api.github.com/repos/nickethier/napalm/subscribers","subscription_url":"https://api.github.com/repos/nickethier/napalm/subscription","commits_url":"https://api.github.com/repos/nickethier/napalm/commits{/sha}","git_commits_url":"https://api.github.com/repos/nickethier/napalm/git/commits{/sha}","comments_url":"https://api.github.com/repos/nickethier/napalm/comments{/number}","issue_comment_url":"https://api.github.com/repos/nickethier/napalm/issues/comments{/number}","contents_url":"https://api.github.com/repos/nickethier/napalm/contents/{+path}","compare_url":"https://api.github.com/repos/nickethier/napalm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nickethier/napalm/merges","archive_url":"https://api.github.com/repos/nickethier/napalm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nickethier/napalm/downloads","issues_url":"https://api.github.com/repos/nickethier/napalm/issues{/number}","pulls_url":"https://api.github.com/repos/nickethier/napalm/pulls{/number}","milestones_url":"https://api.github.com/repos/nickethier/napalm/milestones{/number}","notifications_url":"https://api.github.com/repos/nickethier/napalm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nickethier/napalm/labels{/name}","releases_url":"https://api.github.com/repos/nickethier/napalm/releases{/id}","deployments_url":"https://api.github.com/repos/nickethier/napalm/deployments","created_at":"2017-11-04T01:56:22Z","updated_at":"2017-11-04T01:56:24Z","pushed_at":"2017-11-16T03:12:20Z","git_url":"git://github.com/nickethier/napalm.git","ssh_url":"git@github.com:nickethier/napalm.git","clone_url":"https://github.com/nickethier/napalm.git","svn_url":"https://github.com/nickethier/napalm","homepage":"","size":4866,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"napalm-automation:develop","ref":"develop","sha":"a04c348caef8318b106ce751c66a221a6b7a76d0","user":{"login":"napalm-automation","id":16415577,"avatar_url":"https://avatars2.githubusercontent.com/u/16415577?v=4","gravatar_id":"","url":"https://api.github.com/users/napalm-automation","html_url":"https://github.com/napalm-automation","followers_url":"https://api.github.com/users/napalm-automation/followers","following_url":"https://api.github.com/users/napalm-automation/following{/other_user}","gists_url":"https://api.github.com/users/napalm-automation/gists{/gist_id}","starred_url":"https://api.github.com/users/napalm-automation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/napalm-automation/subscriptions","organizations_url":"https://api.github.com/users/napalm-automation/orgs","repos_url":"https://api.github.com/users/napalm-automation/repos","events_url":"https://api.github.com/users/napalm-automation/events{/privacy}","received_events_url":"https://api.github.com/users/napalm-automation/received_events","type":"Organization","site_admin":false},"repo":{"id":32737992,"name":"napalm","full_name":"napalm-automation/napalm","owner":{"login":"napalm-automation","id":16415577,"avatar_url":"https://avatars2.githubusercontent.com/u/16415577?v=4","gravatar_id":"","url":"https://api.github.com/users/napalm-automation","html_url":"https://github.com/napalm-automation","followers_url":"https://api.github.com/users/napalm-automation/followers","following_url":"https://api.github.com/users/napalm-automation/following{/other_user}","gists_url":"https://api.github.com/users/napalm-automation/gists{/gist_id}","starred_url":"https://api.github.com/users/napalm-automation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/napalm-automation/subscriptions","organizations_url":"https://api.github.com/users/napalm-automation/orgs","repos_url":"https://api.github.com/users/napalm-automation/repos","events_url":"https://api.github.com/users/napalm-automation/events{/privacy}","received_events_url":"https://api.github.com/users/napalm-automation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/napalm-automation/napalm","description":"Network Automation and Programmability Abstraction Layer with Multivendor support","fork":false,"url":"https://api.github.com/repos/napalm-automation/napalm","forks_url":"https://api.github.com/repos/napalm-automation/napalm/forks","keys_url":"https://api.github.com/repos/napalm-automation/napalm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/napalm-automation/napalm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/napalm-automation/napalm/teams","hooks_url":"https://api.github.com/repos/napalm-automation/napalm/hooks","issue_events_url":"https://api.github.com/repos/napalm-automation/napalm/issues/events{/number}","events_url":"https://api.github.com/repos/napalm-automation/napalm/events","assignees_url":"https://api.github.com/repos/napalm-automation/napalm/assignees{/user}","branches_url":"https://api.github.com/repos/napalm-automation/napalm/branches{/branch}","tags_url":"https://api.github.com/repos/napalm-automation/napalm/tags","blobs_url":"https://api.github.com/repos/napalm-automation/napalm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/napalm-automation/napalm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/napalm-automation/napalm/git/refs{/sha}","trees_url":"https://api.github.com/repos/napalm-automation/napalm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/napalm-automation/napalm/statuses/{sha}","languages_url":"https://api.github.com/repos/napalm-automation/napalm/languages","stargazers_url":"https://api.github.com/repos/napalm-automation/napalm/stargazers","contributors_url":"https://api.github.com/repos/napalm-automation/napalm/contributors","subscribers_url":"https://api.github.com/repos/napalm-automation/napalm/subscribers","subscription_url":"https://api.github.com/repos/napalm-automation/napalm/subscription","commits_url":"https://api.github.com/repos/napalm-automation/napalm/commits{/sha}","git_commits_url":"https://api.github.com/repos/napalm-automation/napalm/git/commits{/sha}","comments_url":"https://api.github.com/repos/napalm-automation/napalm/comments{/number}","issue_comment_url":"https://api.github.com/repos/napalm-automation/napalm/issues/comments{/number}","contents_url":"https://api.github.com/repos/napalm-automation/napalm/contents/{+path}","compare_url":"https://api.github.com/repos/napalm-automation/napalm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/napalm-automation/napalm/merges","archive_url":"https://api.github.com/repos/napalm-automation/napalm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/napalm-automation/napalm/downloads","issues_url":"https://api.github.com/repos/napalm-automation/napalm/issues{/number}","pulls_url":"https://api.github.com/repos/napalm-automation/napalm/pulls{/number}","milestones_url":"https://api.github.com/repos/napalm-automation/napalm/milestones{/number}","notifications_url":"https://api.github.com/repos/napalm-automation/napalm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/napalm-automation/napalm/labels{/name}","releases_url":"https://api.github.com/repos/napalm-automation/napalm/releases{/id}","deployments_url":"https://api.github.com/repos/napalm-automation/napalm/deployments","created_at":"2015-03-23T14:43:45Z","updated_at":"2017-11-16T09:45:27Z","pushed_at":"2017-11-16T03:14:32Z","git_url":"git://github.com/napalm-automation/napalm.git","ssh_url":"git@github.com:napalm-automation/napalm.git","clone_url":"https://github.com/napalm-automation/napalm.git","svn_url":"https://github.com/napalm-automation/napalm","homepage":"","size":4846,"stargazers_count":728,"watchers_count":728,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":145,"mirror_url":null,"archived":false,"open_issues_count":89,"forks":145,"open_issues":89,"watchers":728,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/napalm-automation/napalm/pulls/522"},"html":{"href":"https://github.com/napalm-automation/napalm/pull/522"},"issue":{"href":"https://api.github.com/repos/napalm-automation/napalm/issues/522"},"comments":{"href":"https://api.github.com/repos/napalm-automation/napalm/issues/522/comments"},"review_comments":{"href":"https://api.github.com/repos/napalm-automation/napalm/pulls/522/comments"},"review_comment":{"href":"https://api.github.com/repos/napalm-automation/napalm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/napalm-automation/napalm/pulls/522/commits"},"statuses":{"href":"https://api.github.com/repos/napalm-automation/napalm/statuses/7754fefafe5cca56b5f1764662925c0dba15ed9e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bewing"}}