{"action":"created","comment":{"url":"https://api.github.com/repos/saltstack/salt/pulls/comments/208581050","pull_request_review_id":144418008,"id":208581050,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODU4MTA1MA==","diff_hunk":"@@ -2018,6 +2033,13 @@ def load_template(template_name,\n                 }\n             )\n     else:\n+        salt.utils.versions.warn_until(","path":"salt/modules/napalm_network.py","position":423,"original_position":423,"commit_id":"2e992c66979fcb9a459a4e7fa3f2fcc477f93314","original_commit_id":"2e992c66979fcb9a459a4e7fa3f2fcc477f93314","user":{"login":"gtmanfred","id":732321,"node_id":"MDQ6VXNlcjczMjMyMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/732321?v=4","gravatar_id":"","url":"https://api.github.com/users/gtmanfred","html_url":"https://github.com/gtmanfred","followers_url":"https://api.github.com/users/gtmanfred/followers","following_url":"https://api.github.com/users/gtmanfred/following{/other_user}","gists_url":"https://api.github.com/users/gtmanfred/gists{/gist_id}","starred_url":"https://api.github.com/users/gtmanfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtmanfred/subscriptions","organizations_url":"https://api.github.com/users/gtmanfred/orgs","repos_url":"https://api.github.com/users/gtmanfred/repos","events_url":"https://api.github.com/users/gtmanfred/events{/privacy}","received_events_url":"https://api.github.com/users/gtmanfred/received_events","type":"User","site_admin":false},"body":":+1:","created_at":"2018-08-08T13:31:49Z","updated_at":"2018-08-08T13:31:49Z","html_url":"https://github.com/saltstack/salt/pull/48945#discussion_r208581050","pull_request_url":"https://api.github.com/repos/saltstack/salt/pulls/48945","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/saltstack/salt/pulls/comments/208581050"},"html":{"href":"https://github.com/saltstack/salt/pull/48945#discussion_r208581050"},"pull_request":{"href":"https://api.github.com/repos/saltstack/salt/pulls/48945"}},"in_reply_to_id":208547533},"pull_request":{"url":"https://api.github.com/repos/saltstack/salt/pulls/48945","id":206343635,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2MzQzNjM1","html_url":"https://github.com/saltstack/salt/pull/48945","diff_url":"https://github.com/saltstack/salt/pull/48945.diff","patch_url":"https://github.com/saltstack/salt/pull/48945.patch","issue_url":"https://api.github.com/repos/saltstack/salt/issues/48945","number":48945,"state":"open","locked":false,"title":"Rethinking the way configuration management for network devices is handled","user":{"login":"mirceaulinic","id":16694679,"node_id":"MDQ6VXNlcjE2Njk0Njc5","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},"body":"### What does this PR do?\r\n\r\nThere are two root causes for these changes:\r\n\r\n1. The community asked several times to be able to render ore than one template in one go. This is due to the fact that many would prefer having the templates grouped logically and eventually reuse them in other contexts. In other words, break a big Jinja template into smaller and easier to digest parts, that can be later reused in other states.\r\n\r\nI agree with this, and with these changes, this is going to be possible from now on. For example, a state such as:\r\n\r\n```sls\r\nhostname_and_ntp:\r\n  netconfig.managed:\r\n    - template_name:\r\n        - https://bit.ly/2OhSgqP\r\n        - https://bit.ly/2M6C4Lx\r\n        - https://bit.ly/2OIWVTs\r\n    - debug: true\r\n    - context:\r\n        hostname: {{ opts.id }}\r\n        servers:\r\n          - 172.17.17.1\r\n          - 172.17.17.2\r\n        peers:\r\n          - 192.168.0.1\r\n          - 192.168.0.2\r\n```\r\n\r\nWould totally be valid (previously only `template_name: https://bit.ly/2OhSgqP` was possible).\r\n\r\n2. When I firstly implemented the `net.load_template` function more than 2 years ago, I still wasn't fully comfortable with Salt and I didn't have enough experience to evaluate what's the best way to render templates on the fly. This is why I ended up using `file.get_managed`: I was reading the template contents, dumping the rendered result into a temporary file, then reading the contents from there and load them into the device. Not only this is suboptimal, but Salt already has `file.apply_template_on_contents` for this exact purpose, without creating temporary files and all that mess. Using `file.get_managed` made me add a bunch of arguments such as `template_user`, `template_mode` etc., which never made sense, nobody actually used those as they refer to the temporary file which is anyway removed after this function is executed.\r\n\r\nWith this said, I'm swapping the usage of the `file.get_managed` with the more appropriate `file.apply_template_on_contents`. This also means that the `template_user`, `template_mode`, `template_group` et. al. arguments would no longer be used.\r\n\r\nI have removed these arguments in https://github.com/saltstack/salt/commit/b5a642e1171dab75bff247ef22bfa27cf93b6969, but in case this should better be done in a later release I am happy to revert this commit and have the deprecated tags for the time being: https://github.com/saltstack/salt/commit/2ea0cbe159f4b7cbe0a5706b9488f00cff8c309a\r\n\r\nCC @gtmanfred \r\n\r\nNotable byproducts:\r\n\r\n- Faster template rendering.\r\n- Fewer lines of code to maintain.\r\n\r\n\r\n--------\r\n\r\nAfter discussion with @gtmanfred, @rallytime and @terminalmage, (2) is not enough good reason to drop the template hash arguments, therefore we'll continue using `file.get_managed`. However, deprecating `template_user`, `template_group`, etc.","created_at":"2018-08-06T09:44:31Z","updated_at":"2018-08-08T13:31:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5224cb58da1c59b0cb5420f234208c09893ff1fe","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":763449244,"node_id":"MDU6TGFiZWw3NjM0NDkyNDQ=","url":"https://api.github.com/repos/saltstack/salt/labels/Fluorine","name":"Fluorine","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/saltstack/salt/pulls/48945/commits","review_comments_url":"https://api.github.com/repos/saltstack/salt/pulls/48945/comments","review_comment_url":"https://api.github.com/repos/saltstack/salt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/48945/comments","statuses_url":"https://api.github.com/repos/saltstack/salt/statuses/2e992c66979fcb9a459a4e7fa3f2fcc477f93314","head":{"label":"mirceaulinic:rethink-net-config","ref":"rethink-net-config","sha":"2e992c66979fcb9a459a4e7fa3f2fcc477f93314","user":{"login":"mirceaulinic","id":16694679,"node_id":"MDQ6VXNlcjE2Njk0Njc5","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},"repo":{"id":56675393,"node_id":"MDEwOlJlcG9zaXRvcnk1NjY3NTM5Mw==","name":"salt","full_name":"mirceaulinic/salt","owner":{"login":"mirceaulinic","id":16694679,"node_id":"MDQ6VXNlcjE2Njk0Njc5","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},"private":false,"html_url":"https://github.com/mirceaulinic/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":true,"url":"https://api.github.com/repos/mirceaulinic/salt","forks_url":"https://api.github.com/repos/mirceaulinic/salt/forks","keys_url":"https://api.github.com/repos/mirceaulinic/salt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mirceaulinic/salt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mirceaulinic/salt/teams","hooks_url":"https://api.github.com/repos/mirceaulinic/salt/hooks","issue_events_url":"https://api.github.com/repos/mirceaulinic/salt/issues/events{/number}","events_url":"https://api.github.com/repos/mirceaulinic/salt/events","assignees_url":"https://api.github.com/repos/mirceaulinic/salt/assignees{/user}","branches_url":"https://api.github.com/repos/mirceaulinic/salt/branches{/branch}","tags_url":"https://api.github.com/repos/mirceaulinic/salt/tags","blobs_url":"https://api.github.com/repos/mirceaulinic/salt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mirceaulinic/salt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mirceaulinic/salt/git/refs{/sha}","trees_url":"https://api.github.com/repos/mirceaulinic/salt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mirceaulinic/salt/statuses/{sha}","languages_url":"https://api.github.com/repos/mirceaulinic/salt/languages","stargazers_url":"https://api.github.com/repos/mirceaulinic/salt/stargazers","contributors_url":"https://api.github.com/repos/mirceaulinic/salt/contributors","subscribers_url":"https://api.github.com/repos/mirceaulinic/salt/subscribers","subscription_url":"https://api.github.com/repos/mirceaulinic/salt/subscription","commits_url":"https://api.github.com/repos/mirceaulinic/salt/commits{/sha}","git_commits_url":"https://api.github.com/repos/mirceaulinic/salt/git/commits{/sha}","comments_url":"https://api.github.com/repos/mirceaulinic/salt/comments{/number}","issue_comment_url":"https://api.github.com/repos/mirceaulinic/salt/issues/comments{/number}","contents_url":"https://api.github.com/repos/mirceaulinic/salt/contents/{+path}","compare_url":"https://api.github.com/repos/mirceaulinic/salt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mirceaulinic/salt/merges","archive_url":"https://api.github.com/repos/mirceaulinic/salt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mirceaulinic/salt/downloads","issues_url":"https://api.github.com/repos/mirceaulinic/salt/issues{/number}","pulls_url":"https://api.github.com/repos/mirceaulinic/salt/pulls{/number}","milestones_url":"https://api.github.com/repos/mirceaulinic/salt/milestones{/number}","notifications_url":"https://api.github.com/repos/mirceaulinic/salt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mirceaulinic/salt/labels{/name}","releases_url":"https://api.github.com/repos/mirceaulinic/salt/releases{/id}","deployments_url":"https://api.github.com/repos/mirceaulinic/salt/deployments","created_at":"2016-04-20T09:49:28Z","updated_at":"2016-04-20T09:49:41Z","pushed_at":"2018-08-08T11:32:48Z","git_url":"git://github.com/mirceaulinic/salt.git","ssh_url":"git@github.com:mirceaulinic/salt.git","clone_url":"https://github.com/mirceaulinic/salt.git","svn_url":"https://github.com/mirceaulinic/salt","homepage":"https://repo.saltstack.com/","size":411519,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"saltstack:fluorine","ref":"fluorine","sha":"c3160f3c497c504c3f9863d82c1234e75d40eecf","user":{"login":"saltstack","id":1147473,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNDc0NzM=","avatar_url":"https://avatars3.githubusercontent.com/u/1147473?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkwMjQ4","name":"salt","full_name":"saltstack/salt","owner":{"login":"saltstack","id":1147473,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNDc0NzM=","avatar_url":"https://avatars3.githubusercontent.com/u/1147473?v=4","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 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":"2018-08-08T09:27:31Z","pushed_at":"2018-08-08T13:29:06Z","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":412893,"stargazers_count":9094,"watchers_count":9094,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4248,"mirror_url":null,"archived":false,"open_issues_count":2862,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":4248,"open_issues":2862,"watchers":9094,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/saltstack/salt/pulls/48945"},"html":{"href":"https://github.com/saltstack/salt/pull/48945"},"issue":{"href":"https://api.github.com/repos/saltstack/salt/issues/48945"},"comments":{"href":"https://api.github.com/repos/saltstack/salt/issues/48945/comments"},"review_comments":{"href":"https://api.github.com/repos/saltstack/salt/pulls/48945/comments"},"review_comment":{"href":"https://api.github.com/repos/saltstack/salt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/saltstack/salt/pulls/48945/commits"},"statuses":{"href":"https://api.github.com/repos/saltstack/salt/statuses/2e992c66979fcb9a459a4e7fa3f2fcc477f93314"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"gtmanfred"}}