{"action":"created","comment":{"url":"https://api.github.com/repos/electric-cloud/EC-Chef/pulls/comments/45409421","id":45409421,"diff_hunk":"@@ -0,0 +1,96 @@\n+#\n+#  Copyright 2015 Electric Cloud, Inc.\n+#\n+#  Licensed under the Apache License, Version 2.0 (the \"License\");\n+#  you may not use this file except in compliance with the License.\n+#  You may obtain a copy of the License at\n+#\n+#      http://www.apache.org/licenses/LICENSE-2.0\n+#\n+#  Unless required by applicable law or agreed to in writing, software\n+#  distributed under the License is distributed on an \"AS IS\" BASIS,\n+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+#  See the License for the specific language governing permissions and\n+#  limitations under the License.\n+#\n+\n+# -------------------------------------------------------------------------\n+# Includes\n+# -------------------------------------------------------------------------\n+use Cwd;\n+use Carp;\n+use strict;\n+use Data::Dumper;\n+use utf8;\n+use Encode;\n+use warnings;\n+use diagnostics;\n+use open IO => ':encoding(utf8)';\n+use File::Basename;\n+use ElectricCommander;\n+use ElectricCommander::PropDB;\n+use ElectricCommander::PropMod;\n+\n+$| = 1;\n+\n+# -------------------------------------------------------------------------\n+# Main functions\n+# -------------------------------------------------------------------------\n+\n+###########################################################################\n+\n+=head2 main\n+ \n+  Title    : main\n+  Usage    : main();\n+  Function : Performs a Chef run\n+  Returns  : none\n+  Args     : named arguments: none\n+=cut\n+\n+###########################################################################\n+\n+sub main {\n+    my $ec = ElectricCommander->new();\n+    $ec->abortOnError(0);\n+\n+    # -------------------------------------------------------------------------\n+    # Parameters\n+    # -------------------------------------------------------------------------\n+    $::g_knife_path =\n+      ( $ec->getProperty(\"knife_path\") )->findvalue('//value')->string_value;\n+    $::g_node_name =\n+      ( $ec->getProperty(\"node_name\") )->findvalue('//value')->string_value;\n+    $::g_additional_options =\n+      ( $ec->getProperty(\"additional_options\") )->findvalue('//value')\n+      ->string_value;\n+\n+    #Variable that stores the command to be executed\n+    $::g_command = $::g_knife_path . \" node create -d\";\n+\n+    my @cmd;\n+    my %props;\n+\n+    #Prints procedure and parameters information\n+    my $pluginKey  = 'EC-Chef';\n+    my $xpath      = $ec->getPlugin($pluginKey);\n+    my $pluginName = $xpath->findvalue('//pluginVersion')->value;\n+    print \"Using plugin $pluginKey version $pluginName\\n\";\n+    print \"Running procedure CreateNode\\n\";\n+\n+    #Parameters are checked to see which should be included\n+    if ( $::g_node_name && $::g_node_name ne '' ) {\n+        $::g_command = $::g_command . \" \" . $::g_node_name;\n+    }\n+    if ( $::g_additional_options && $::g_additional_options ne '' ) {\n+        $::g_command = $::g_command . \" \" . $::g_additional_options;\n+    }\n+\n+    #Print out the command to be executed\n+    print \"\\nCommand to be executed: \\n$::g_command \\n\\n\";\n+\n+    #Execute the command\n+    system(\"$::g_command\");","path":"src/main/resources/project/drivers/CreateNodeDriver.pl","position":93,"original_position":93,"commit_id":"d1db494f5619b757d133af43b0498c1a14016ebb","original_commit_id":"d1db494f5619b757d133af43b0498c1a14016ebb","user":{"login":"nikhilv","id":691503,"avatar_url":"https://avatars.githubusercontent.com/u/691503?v=3","gravatar_id":"","url":"https://api.github.com/users/nikhilv","html_url":"https://github.com/nikhilv","followers_url":"https://api.github.com/users/nikhilv/followers","following_url":"https://api.github.com/users/nikhilv/following{/other_user}","gists_url":"https://api.github.com/users/nikhilv/gists{/gist_id}","starred_url":"https://api.github.com/users/nikhilv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikhilv/subscriptions","organizations_url":"https://api.github.com/users/nikhilv/orgs","repos_url":"https://api.github.com/users/nikhilv/repos","events_url":"https://api.github.com/users/nikhilv/events{/privacy}","received_events_url":"https://api.github.com/users/nikhilv/received_events","type":"User","site_admin":false},"body":"Check out how we do this in EC-Puppet - https://github.com/electric-cloud/EC-Puppet/blob/806c96c8b2f060819d394efc786babd2a539d67c/src/main/resources/project/RunManifestDriver.pl","created_at":"2015-11-19T22:17:59Z","updated_at":"2015-11-19T22:17:59Z","html_url":"https://github.com/electric-cloud/EC-Chef/pull/11#discussion_r45409421","pull_request_url":"https://api.github.com/repos/electric-cloud/EC-Chef/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/electric-cloud/EC-Chef/pulls/comments/45409421"},"html":{"href":"https://github.com/electric-cloud/EC-Chef/pull/11#discussion_r45409421"},"pull_request":{"href":"https://api.github.com/repos/electric-cloud/EC-Chef/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/electric-cloud/EC-Chef/pulls/11","id":51255764,"html_url":"https://github.com/electric-cloud/EC-Chef/pull/11","diff_url":"https://github.com/electric-cloud/EC-Chef/pull/11.diff","patch_url":"https://github.com/electric-cloud/EC-Chef/pull/11.patch","issue_url":"https://api.github.com/repos/electric-cloud/EC-Chef/issues/11","number":11,"state":"open","locked":false,"title":"All Node features with unit testing","user":{"login":"anandjainjk","id":10236213,"avatar_url":"https://avatars.githubusercontent.com/u/10236213?v=3","gravatar_id":"","url":"https://api.github.com/users/anandjainjk","html_url":"https://github.com/anandjainjk","followers_url":"https://api.github.com/users/anandjainjk/followers","following_url":"https://api.github.com/users/anandjainjk/following{/other_user}","gists_url":"https://api.github.com/users/anandjainjk/gists{/gist_id}","starred_url":"https://api.github.com/users/anandjainjk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anandjainjk/subscriptions","organizations_url":"https://api.github.com/users/anandjainjk/orgs","repos_url":"https://api.github.com/users/anandjainjk/repos","events_url":"https://api.github.com/users/anandjainjk/events{/privacy}","received_events_url":"https://api.github.com/users/anandjainjk/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-19T17:42:23Z","updated_at":"2015-11-19T22:17:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ff82629b9fba2b7664dc8c5489185c9bb283b61","assignee":{"login":"nikhilv","id":691503,"avatar_url":"https://avatars.githubusercontent.com/u/691503?v=3","gravatar_id":"","url":"https://api.github.com/users/nikhilv","html_url":"https://github.com/nikhilv","followers_url":"https://api.github.com/users/nikhilv/followers","following_url":"https://api.github.com/users/nikhilv/following{/other_user}","gists_url":"https://api.github.com/users/nikhilv/gists{/gist_id}","starred_url":"https://api.github.com/users/nikhilv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikhilv/subscriptions","organizations_url":"https://api.github.com/users/nikhilv/orgs","repos_url":"https://api.github.com/users/nikhilv/repos","events_url":"https://api.github.com/users/nikhilv/events{/privacy}","received_events_url":"https://api.github.com/users/nikhilv/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/electric-cloud/EC-Chef/pulls/11/commits","review_comments_url":"https://api.github.com/repos/electric-cloud/EC-Chef/pulls/11/comments","review_comment_url":"https://api.github.com/repos/electric-cloud/EC-Chef/pulls/comments{/number}","comments_url":"https://api.github.com/repos/electric-cloud/EC-Chef/issues/11/comments","statuses_url":"https://api.github.com/repos/electric-cloud/EC-Chef/statuses/d1db494f5619b757d133af43b0498c1a14016ebb","head":{"label":"electric-cloud:develop","ref":"develop","sha":"d1db494f5619b757d133af43b0498c1a14016ebb","user":{"login":"electric-cloud","id":1568775,"avatar_url":"https://avatars.githubusercontent.com/u/1568775?v=3","gravatar_id":"","url":"https://api.github.com/users/electric-cloud","html_url":"https://github.com/electric-cloud","followers_url":"https://api.github.com/users/electric-cloud/followers","following_url":"https://api.github.com/users/electric-cloud/following{/other_user}","gists_url":"https://api.github.com/users/electric-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/electric-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electric-cloud/subscriptions","organizations_url":"https://api.github.com/users/electric-cloud/orgs","repos_url":"https://api.github.com/users/electric-cloud/repos","events_url":"https://api.github.com/users/electric-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/electric-cloud/received_events","type":"Organization","site_admin":false},"repo":{"id":39163407,"name":"EC-Chef","full_name":"electric-cloud/EC-Chef","owner":{"login":"electric-cloud","id":1568775,"avatar_url":"https://avatars.githubusercontent.com/u/1568775?v=3","gravatar_id":"","url":"https://api.github.com/users/electric-cloud","html_url":"https://github.com/electric-cloud","followers_url":"https://api.github.com/users/electric-cloud/followers","following_url":"https://api.github.com/users/electric-cloud/following{/other_user}","gists_url":"https://api.github.com/users/electric-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/electric-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electric-cloud/subscriptions","organizations_url":"https://api.github.com/users/electric-cloud/orgs","repos_url":"https://api.github.com/users/electric-cloud/repos","events_url":"https://api.github.com/users/electric-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/electric-cloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/electric-cloud/EC-Chef","description":"ElectricFlow integration for Chef","fork":false,"url":"https://api.github.com/repos/electric-cloud/EC-Chef","forks_url":"https://api.github.com/repos/electric-cloud/EC-Chef/forks","keys_url":"https://api.github.com/repos/electric-cloud/EC-Chef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electric-cloud/EC-Chef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electric-cloud/EC-Chef/teams","hooks_url":"https://api.github.com/repos/electric-cloud/EC-Chef/hooks","issue_events_url":"https://api.github.com/repos/electric-cloud/EC-Chef/issues/events{/number}","events_url":"https://api.github.com/repos/electric-cloud/EC-Chef/events","assignees_url":"https://api.github.com/repos/electric-cloud/EC-Chef/assignees{/user}","branches_url":"https://api.github.com/repos/electric-cloud/EC-Chef/branches{/branch}","tags_url":"https://api.github.com/repos/electric-cloud/EC-Chef/tags","blobs_url":"https://api.github.com/repos/electric-cloud/EC-Chef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electric-cloud/EC-Chef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electric-cloud/EC-Chef/git/refs{/sha}","trees_url":"https://api.github.com/repos/electric-cloud/EC-Chef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electric-cloud/EC-Chef/statuses/{sha}","languages_url":"https://api.github.com/repos/electric-cloud/EC-Chef/languages","stargazers_url":"https://api.github.com/repos/electric-cloud/EC-Chef/stargazers","contributors_url":"https://api.github.com/repos/electric-cloud/EC-Chef/contributors","subscribers_url":"https://api.github.com/repos/electric-cloud/EC-Chef/subscribers","subscription_url":"https://api.github.com/repos/electric-cloud/EC-Chef/subscription","commits_url":"https://api.github.com/repos/electric-cloud/EC-Chef/commits{/sha}","git_commits_url":"https://api.github.com/repos/electric-cloud/EC-Chef/git/commits{/sha}","comments_url":"https://api.github.com/repos/electric-cloud/EC-Chef/comments{/number}","issue_comment_url":"https://api.github.com/repos/electric-cloud/EC-Chef/issues/comments{/number}","contents_url":"https://api.github.com/repos/electric-cloud/EC-Chef/contents/{+path}","compare_url":"https://api.github.com/repos/electric-cloud/EC-Chef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electric-cloud/EC-Chef/merges","archive_url":"https://api.github.com/repos/electric-cloud/EC-Chef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electric-cloud/EC-Chef/downloads","issues_url":"https://api.github.com/repos/electric-cloud/EC-Chef/issues{/number}","pulls_url":"https://api.github.com/repos/electric-cloud/EC-Chef/pulls{/number}","milestones_url":"https://api.github.com/repos/electric-cloud/EC-Chef/milestones{/number}","notifications_url":"https://api.github.com/repos/electric-cloud/EC-Chef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electric-cloud/EC-Chef/labels{/name}","releases_url":"https://api.github.com/repos/electric-cloud/EC-Chef/releases{/id}","created_at":"2015-07-15T22:01:57Z","updated_at":"2015-10-16T19:40:31Z","pushed_at":"2015-11-19T20:14:27Z","git_url":"git://github.com/electric-cloud/EC-Chef.git","ssh_url":"git@github.com:electric-cloud/EC-Chef.git","clone_url":"https://github.com/electric-cloud/EC-Chef.git","svn_url":"https://github.com/electric-cloud/EC-Chef","homepage":"","size":2907,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":8,"forks":1,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"electric-cloud:master","ref":"master","sha":"3ef0d822b678535f735f6e758d610fe549b306cb","user":{"login":"electric-cloud","id":1568775,"avatar_url":"https://avatars.githubusercontent.com/u/1568775?v=3","gravatar_id":"","url":"https://api.github.com/users/electric-cloud","html_url":"https://github.com/electric-cloud","followers_url":"https://api.github.com/users/electric-cloud/followers","following_url":"https://api.github.com/users/electric-cloud/following{/other_user}","gists_url":"https://api.github.com/users/electric-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/electric-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electric-cloud/subscriptions","organizations_url":"https://api.github.com/users/electric-cloud/orgs","repos_url":"https://api.github.com/users/electric-cloud/repos","events_url":"https://api.github.com/users/electric-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/electric-cloud/received_events","type":"Organization","site_admin":false},"repo":{"id":39163407,"name":"EC-Chef","full_name":"electric-cloud/EC-Chef","owner":{"login":"electric-cloud","id":1568775,"avatar_url":"https://avatars.githubusercontent.com/u/1568775?v=3","gravatar_id":"","url":"https://api.github.com/users/electric-cloud","html_url":"https://github.com/electric-cloud","followers_url":"https://api.github.com/users/electric-cloud/followers","following_url":"https://api.github.com/users/electric-cloud/following{/other_user}","gists_url":"https://api.github.com/users/electric-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/electric-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electric-cloud/subscriptions","organizations_url":"https://api.github.com/users/electric-cloud/orgs","repos_url":"https://api.github.com/users/electric-cloud/repos","events_url":"https://api.github.com/users/electric-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/electric-cloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/electric-cloud/EC-Chef","description":"ElectricFlow integration for Chef","fork":false,"url":"https://api.github.com/repos/electric-cloud/EC-Chef","forks_url":"https://api.github.com/repos/electric-cloud/EC-Chef/forks","keys_url":"https://api.github.com/repos/electric-cloud/EC-Chef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electric-cloud/EC-Chef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electric-cloud/EC-Chef/teams","hooks_url":"https://api.github.com/repos/electric-cloud/EC-Chef/hooks","issue_events_url":"https://api.github.com/repos/electric-cloud/EC-Chef/issues/events{/number}","events_url":"https://api.github.com/repos/electric-cloud/EC-Chef/events","assignees_url":"https://api.github.com/repos/electric-cloud/EC-Chef/assignees{/user}","branches_url":"https://api.github.com/repos/electric-cloud/EC-Chef/branches{/branch}","tags_url":"https://api.github.com/repos/electric-cloud/EC-Chef/tags","blobs_url":"https://api.github.com/repos/electric-cloud/EC-Chef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electric-cloud/EC-Chef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electric-cloud/EC-Chef/git/refs{/sha}","trees_url":"https://api.github.com/repos/electric-cloud/EC-Chef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electric-cloud/EC-Chef/statuses/{sha}","languages_url":"https://api.github.com/repos/electric-cloud/EC-Chef/languages","stargazers_url":"https://api.github.com/repos/electric-cloud/EC-Chef/stargazers","contributors_url":"https://api.github.com/repos/electric-cloud/EC-Chef/contributors","subscribers_url":"https://api.github.com/repos/electric-cloud/EC-Chef/subscribers","subscription_url":"https://api.github.com/repos/electric-cloud/EC-Chef/subscription","commits_url":"https://api.github.com/repos/electric-cloud/EC-Chef/commits{/sha}","git_commits_url":"https://api.github.com/repos/electric-cloud/EC-Chef/git/commits{/sha}","comments_url":"https://api.github.com/repos/electric-cloud/EC-Chef/comments{/number}","issue_comment_url":"https://api.github.com/repos/electric-cloud/EC-Chef/issues/comments{/number}","contents_url":"https://api.github.com/repos/electric-cloud/EC-Chef/contents/{+path}","compare_url":"https://api.github.com/repos/electric-cloud/EC-Chef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electric-cloud/EC-Chef/merges","archive_url":"https://api.github.com/repos/electric-cloud/EC-Chef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electric-cloud/EC-Chef/downloads","issues_url":"https://api.github.com/repos/electric-cloud/EC-Chef/issues{/number}","pulls_url":"https://api.github.com/repos/electric-cloud/EC-Chef/pulls{/number}","milestones_url":"https://api.github.com/repos/electric-cloud/EC-Chef/milestones{/number}","notifications_url":"https://api.github.com/repos/electric-cloud/EC-Chef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electric-cloud/EC-Chef/labels{/name}","releases_url":"https://api.github.com/repos/electric-cloud/EC-Chef/releases{/id}","created_at":"2015-07-15T22:01:57Z","updated_at":"2015-10-16T19:40:31Z","pushed_at":"2015-11-19T20:14:27Z","git_url":"git://github.com/electric-cloud/EC-Chef.git","ssh_url":"git@github.com:electric-cloud/EC-Chef.git","clone_url":"https://github.com/electric-cloud/EC-Chef.git","svn_url":"https://github.com/electric-cloud/EC-Chef","homepage":"","size":2907,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":8,"forks":1,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/electric-cloud/EC-Chef/pulls/11"},"html":{"href":"https://github.com/electric-cloud/EC-Chef/pull/11"},"issue":{"href":"https://api.github.com/repos/electric-cloud/EC-Chef/issues/11"},"comments":{"href":"https://api.github.com/repos/electric-cloud/EC-Chef/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/electric-cloud/EC-Chef/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/electric-cloud/EC-Chef/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/electric-cloud/EC-Chef/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/electric-cloud/EC-Chef/statuses/d1db494f5619b757d133af43b0498c1a14016ebb"}}}}