{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/166615795","pull_request_review_id":94706010,"id":166615795,"diff_hunk":"@@ -318,6 +320,41 @@\n       expect { @device.main }.to exit_with 1\n     end\n \n+    it \"should exit if apply is set, and target is not\" do\n+      @device.options.stubs(:[]).with(:apply).returns('file.pp')\n+      Puppet.expects(:err).with(regexp_matches(/missing argument.* --target/))\n+      expect { @device.main }.to exit_with 1\n+    end\n+\n+    it \"should error if target is passed and the apply path is incorrect\" do\n+      @device.options.stubs(:[]).with(:apply).returns('file.pp')\n+      @device.options.stubs(:[]).with(:target).returns('device1')\n+      device_hash = {\n+        \"device1\" => OpenStruct.new(:name => \"device1\", :url => \"ssh://user:pass@testhost\", :provider => \"cisco\"),\n+      }\n+\n+      Puppet::Util::NetworkDevice::Config.expects(:devices).returns(device_hash)\n+      File.expects(:file?).returns(false)\n+      Puppet.expects(:err).with(regexp_matches(/does not exist, cannot apply/))\n+      expect { @device.main }.to exit_with 1\n+    end\n+\n+    it \"should run an apply\" do\n+      @device.options.stubs(:[]).with(:apply).returns('file.pp')\n+      @device.options.stubs(:[]).with(:target).returns('device1')\n+      device_hash = {\n+        \"device1\" => OpenStruct.new(:name => \"device1\", :url => \"ssh://user:pass@testhost\", :provider => \"cisco\", :options => {}),","path":"spec/unit/application/device_spec.rb","position":43,"original_position":43,"commit_id":"9474a028e0873b37fa2841fbcbe4f64d13b3dc26","original_commit_id":"9474a028e0873b37fa2841fbcbe4f64d13b3dc26","user":{"login":"thallgren","id":209495,"avatar_url":"https://avatars2.githubusercontent.com/u/209495?v=4","gravatar_id":"","url":"https://api.github.com/users/thallgren","html_url":"https://github.com/thallgren","followers_url":"https://api.github.com/users/thallgren/followers","following_url":"https://api.github.com/users/thallgren/following{/other_user}","gists_url":"https://api.github.com/users/thallgren/gists{/gist_id}","starred_url":"https://api.github.com/users/thallgren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thallgren/subscriptions","organizations_url":"https://api.github.com/users/thallgren/orgs","repos_url":"https://api.github.com/users/thallgren/repos","events_url":"https://api.github.com/users/thallgren/events{/privacy}","received_events_url":"https://api.github.com/users/thallgren/received_events","type":"User","site_admin":false},"body":"Hmm. Now the test fails because 'file.pp' isn't a file. Did something else change?","created_at":"2018-02-07T13:27:26Z","updated_at":"2018-02-07T13:27:26Z","html_url":"https://github.com/puppetlabs/puppet/pull/6559#discussion_r166615795","pull_request_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/6559","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/166615795"},"html":{"href":"https://github.com/puppetlabs/puppet/pull/6559#discussion_r166615795"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/6559"}},"in_reply_to_id":166608837},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppet/pulls/6559","id":164387859,"html_url":"https://github.com/puppetlabs/puppet/pull/6559","diff_url":"https://github.com/puppetlabs/puppet/pull/6559.diff","patch_url":"https://github.com/puppetlabs/puppet/pull/6559.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppet/issues/6559","number":6559,"state":"open","locked":false,"title":"(PUP-8364) apply like functionality for device","user":{"login":"tphoney","id":10402706,"avatar_url":"https://avatars2.githubusercontent.com/u/10402706?v=4","gravatar_id":"","url":"https://api.github.com/users/tphoney","html_url":"https://github.com/tphoney","followers_url":"https://api.github.com/users/tphoney/followers","following_url":"https://api.github.com/users/tphoney/following{/other_user}","gists_url":"https://api.github.com/users/tphoney/gists{/gist_id}","starred_url":"https://api.github.com/users/tphoney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tphoney/subscriptions","organizations_url":"https://api.github.com/users/tphoney/orgs","repos_url":"https://api.github.com/users/tphoney/repos","events_url":"https://api.github.com/users/tphoney/events{/privacy}","received_events_url":"https://api.github.com/users/tphoney/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-01-22T18:55:41Z","updated_at":"2018-02-07T13:27:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"973149b1fbc3db02d714a90c34fa7ad40f25299a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/6559/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/6559/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/puppet/issues/6559/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppet/statuses/9474a028e0873b37fa2841fbcbe4f64d13b3dc26","head":{"label":"tphoney:FM-6694","ref":"FM-6694","sha":"9474a028e0873b37fa2841fbcbe4f64d13b3dc26","user":{"login":"tphoney","id":10402706,"avatar_url":"https://avatars2.githubusercontent.com/u/10402706?v=4","gravatar_id":"","url":"https://api.github.com/users/tphoney","html_url":"https://github.com/tphoney","followers_url":"https://api.github.com/users/tphoney/followers","following_url":"https://api.github.com/users/tphoney/following{/other_user}","gists_url":"https://api.github.com/users/tphoney/gists{/gist_id}","starred_url":"https://api.github.com/users/tphoney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tphoney/subscriptions","organizations_url":"https://api.github.com/users/tphoney/orgs","repos_url":"https://api.github.com/users/tphoney/repos","events_url":"https://api.github.com/users/tphoney/events{/privacy}","received_events_url":"https://api.github.com/users/tphoney/received_events","type":"User","site_admin":false},"repo":{"id":86313278,"name":"puppet","full_name":"tphoney/puppet","owner":{"login":"tphoney","id":10402706,"avatar_url":"https://avatars2.githubusercontent.com/u/10402706?v=4","gravatar_id":"","url":"https://api.github.com/users/tphoney","html_url":"https://github.com/tphoney","followers_url":"https://api.github.com/users/tphoney/followers","following_url":"https://api.github.com/users/tphoney/following{/other_user}","gists_url":"https://api.github.com/users/tphoney/gists{/gist_id}","starred_url":"https://api.github.com/users/tphoney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tphoney/subscriptions","organizations_url":"https://api.github.com/users/tphoney/orgs","repos_url":"https://api.github.com/users/tphoney/repos","events_url":"https://api.github.com/users/tphoney/events{/privacy}","received_events_url":"https://api.github.com/users/tphoney/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tphoney/puppet","description":"Server automation framework and application","fork":true,"url":"https://api.github.com/repos/tphoney/puppet","forks_url":"https://api.github.com/repos/tphoney/puppet/forks","keys_url":"https://api.github.com/repos/tphoney/puppet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tphoney/puppet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tphoney/puppet/teams","hooks_url":"https://api.github.com/repos/tphoney/puppet/hooks","issue_events_url":"https://api.github.com/repos/tphoney/puppet/issues/events{/number}","events_url":"https://api.github.com/repos/tphoney/puppet/events","assignees_url":"https://api.github.com/repos/tphoney/puppet/assignees{/user}","branches_url":"https://api.github.com/repos/tphoney/puppet/branches{/branch}","tags_url":"https://api.github.com/repos/tphoney/puppet/tags","blobs_url":"https://api.github.com/repos/tphoney/puppet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tphoney/puppet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tphoney/puppet/git/refs{/sha}","trees_url":"https://api.github.com/repos/tphoney/puppet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tphoney/puppet/statuses/{sha}","languages_url":"https://api.github.com/repos/tphoney/puppet/languages","stargazers_url":"https://api.github.com/repos/tphoney/puppet/stargazers","contributors_url":"https://api.github.com/repos/tphoney/puppet/contributors","subscribers_url":"https://api.github.com/repos/tphoney/puppet/subscribers","subscription_url":"https://api.github.com/repos/tphoney/puppet/subscription","commits_url":"https://api.github.com/repos/tphoney/puppet/commits{/sha}","git_commits_url":"https://api.github.com/repos/tphoney/puppet/git/commits{/sha}","comments_url":"https://api.github.com/repos/tphoney/puppet/comments{/number}","issue_comment_url":"https://api.github.com/repos/tphoney/puppet/issues/comments{/number}","contents_url":"https://api.github.com/repos/tphoney/puppet/contents/{+path}","compare_url":"https://api.github.com/repos/tphoney/puppet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tphoney/puppet/merges","archive_url":"https://api.github.com/repos/tphoney/puppet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tphoney/puppet/downloads","issues_url":"https://api.github.com/repos/tphoney/puppet/issues{/number}","pulls_url":"https://api.github.com/repos/tphoney/puppet/pulls{/number}","milestones_url":"https://api.github.com/repos/tphoney/puppet/milestones{/number}","notifications_url":"https://api.github.com/repos/tphoney/puppet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tphoney/puppet/labels{/name}","releases_url":"https://api.github.com/repos/tphoney/puppet/releases{/id}","deployments_url":"https://api.github.com/repos/tphoney/puppet/deployments","created_at":"2017-03-27T08:57:30Z","updated_at":"2017-03-27T08:57:43Z","pushed_at":"2018-02-07T12:48:34Z","git_url":"git://github.com/tphoney/puppet.git","ssh_url":"git@github.com:tphoney/puppet.git","clone_url":"https://github.com/tphoney/puppet.git","svn_url":"https://github.com/tphoney/puppet","homepage":"https://puppet.com/puppet/what-is-puppet","size":62420,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"09724165058d85e0792eb534d17c4188af76bcca","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars0.githubusercontent.com/u/234268?v=4","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":910744,"name":"puppet","full_name":"puppetlabs/puppet","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars0.githubusercontent.com/u/234268?v=4","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/puppet","description":"Server automation framework and application","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppet","forks_url":"https://api.github.com/repos/puppetlabs/puppet/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppet/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppet/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppet/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppet/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppet/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppet/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppet/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppet/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppet/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppet/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppet/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppet/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppet/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppet/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppet/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppet/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppet/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppet/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/puppet/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppet/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppet/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppet/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppet/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppet/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppet/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppet/releases{/id}","deployments_url":"https://api.github.com/repos/puppetlabs/puppet/deployments","created_at":"2010-09-14T19:26:44Z","updated_at":"2018-02-07T08:06:46Z","pushed_at":"2018-02-07T12:48:36Z","git_url":"git://github.com/puppetlabs/puppet.git","ssh_url":"git@github.com:puppetlabs/puppet.git","clone_url":"https://github.com/puppetlabs/puppet.git","svn_url":"https://github.com/puppetlabs/puppet","homepage":"https://puppet.com/puppet/what-is-puppet","size":62469,"stargazers_count":4859,"watchers_count":4859,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1977,"mirror_url":null,"archived":false,"open_issues_count":40,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1977,"open_issues":40,"watchers":4859,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/6559"},"html":{"href":"https://github.com/puppetlabs/puppet/pull/6559"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppet/issues/6559"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppet/issues/6559/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/6559/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/6559/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppet/statuses/9474a028e0873b37fa2841fbcbe4f64d13b3dc26"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"thallgren"}}