{"action":"created","comment":{"url":"https://api.github.com/repos/chef-partners/azure-chef-extension/pulls/comments/75980277","id":75980277,"diff_hunk":"@@ -6,74 +6,45 @@ class ChefService\n   include ChefAzure::Shared\r\n   AZURE_CHEF_SERVICE_PID_FILE = \"azure-chef-client.pid\"\r\n   AZURE_CHEF_CRON_NAME = 'azure_chef_extension'\r\n+  DEFAULT_CHEF_SERVICE_INTERVAL = 30\r\n+  CLIENT_RB_INTERVAL_ATTRIBUTE_NAME = 'interval'\r\n \r\n-  # TODO - make these methods idempotent\r\n-  def install(log_location)\r\n-    log_location = log_location || bootstrap_directory # example default logs go to C:\\chef\\\r\n-    exit_code = 0\r\n-    message = \"success\"\r\n-    error_message = \"Error installing chef-client service\"\r\n-    begin\r\n-      if windows?\r\n-        puts \"#{Time.now} Getting chef-client service status\"\r\n-        status = shell_out(\"sc.exe query chef-client\")\r\n-        if status.exitstatus == 1060 && status.stdout.include?(\"The specified service does not exist as an installed service.\")\r\n-          puts \"#{Time.now} Installing chef-client service...\"\r\n-          params = \" -a install -c #{bootstrap_directory}\\\\client.rb -L #{log_location}\\\\chef-client.log \"\r\n-          result = shell_out(\"chef-service-manager #{params}\")\r\n-          result.error!\r\n-          puts \"#{Time.now} Installed chef-client service.\"\r\n-        else\r\n-          status.error!\r\n-          puts \"#{Time.now} chef-client service is already installed.\"\r\n-        end\r\n-      end\r\n-      # Unix - only start chef-client in daemonize mode using self.enable\r\n-    rescue => e\r\n-      Chef::Log.error \"#{error_message} (#{e})\"\r\n-      message = \"#{error_message}- #{e} - Check log file for details\"\r\n-      exit_code = 1\r\n-    end\r\n-    [exit_code, message]\r\n-  end\r\n-\r\n-  def enable(extension_root, bootstrap_directory, log_location)\r\n+  def enable(extension_root, log_location, chef_service_interval = DEFAULT_CHEF_SERVICE_INTERVAL)\r","path":"lib/chef/azure/service.rb","position":38,"original_position":38,"commit_id":"127d1ea60b3832bc4aa3be39ec504b8b51e58914","original_commit_id":"0aafce2a841a861b1ec01090dc61af0ae34c1ea8","user":{"login":"mwrock","id":655165,"avatar_url":"https://avatars.githubusercontent.com/u/655165?v=3","gravatar_id":"","url":"https://api.github.com/users/mwrock","html_url":"https://github.com/mwrock","followers_url":"https://api.github.com/users/mwrock/followers","following_url":"https://api.github.com/users/mwrock/following{/other_user}","gists_url":"https://api.github.com/users/mwrock/gists{/gist_id}","starred_url":"https://api.github.com/users/mwrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwrock/subscriptions","organizations_url":"https://api.github.com/users/mwrock/orgs","repos_url":"https://api.github.com/users/mwrock/repos","events_url":"https://api.github.com/users/mwrock/events{/privacy}","received_events_url":"https://api.github.com/users/mwrock/received_events","type":"User","site_admin":false},"body":"ok. If the service is going to own the logic around adjusting interval time and tweaking the `client.config` then it should fully own it by taking over what to do when the interval is 0. See my comment above in enable.rb.","created_at":"2016-08-24T01:10:01Z","updated_at":"2016-08-24T01:10:01Z","html_url":"https://github.com/chef-partners/azure-chef-extension/pull/161#discussion_r75980277","pull_request_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/pulls/161","_links":{"self":{"href":"https://api.github.com/repos/chef-partners/azure-chef-extension/pulls/comments/75980277"},"html":{"href":"https://github.com/chef-partners/azure-chef-extension/pull/161#discussion_r75980277"},"pull_request":{"href":"https://api.github.com/repos/chef-partners/azure-chef-extension/pulls/161"}}},"pull_request":{"url":"https://api.github.com/repos/chef-partners/azure-chef-extension/pulls/161","id":80944412,"html_url":"https://github.com/chef-partners/azure-chef-extension/pull/161","diff_url":"https://github.com/chef-partners/azure-chef-extension/pull/161.diff","patch_url":"https://github.com/chef-partners/azure-chef-extension/pull/161.patch","issue_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/issues/161","number":161,"state":"open","locked":false,"title":"Added code to read chef_service_interval from extension config file and process it.","user":{"login":"Aliasgar16","id":12524327,"avatar_url":"https://avatars.githubusercontent.com/u/12524327?v=3","gravatar_id":"","url":"https://api.github.com/users/Aliasgar16","html_url":"https://github.com/Aliasgar16","followers_url":"https://api.github.com/users/Aliasgar16/followers","following_url":"https://api.github.com/users/Aliasgar16/following{/other_user}","gists_url":"https://api.github.com/users/Aliasgar16/gists{/gist_id}","starred_url":"https://api.github.com/users/Aliasgar16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aliasgar16/subscriptions","organizations_url":"https://api.github.com/users/Aliasgar16/orgs","repos_url":"https://api.github.com/users/Aliasgar16/repos","events_url":"https://api.github.com/users/Aliasgar16/events{/privacy}","received_events_url":"https://api.github.com/users/Aliasgar16/received_events","type":"User","site_admin":false},"body":"In-progress.","created_at":"2016-08-11T11:51:35Z","updated_at":"2016-08-24T01:10:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ec10c04652ced15901453eeb877921ab2fd9f99","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/pulls/161/commits","review_comments_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/pulls/161/comments","review_comment_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/issues/161/comments","statuses_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/statuses/127d1ea60b3832bc4aa3be39ec504b8b51e58914","head":{"label":"MsysTechnologiesllc:ali/add_chef_service_interval","ref":"ali/add_chef_service_interval","sha":"127d1ea60b3832bc4aa3be39ec504b8b51e58914","user":{"login":"MsysTechnologiesllc","id":2493241,"avatar_url":"https://avatars.githubusercontent.com/u/2493241?v=3","gravatar_id":"","url":"https://api.github.com/users/MsysTechnologiesllc","html_url":"https://github.com/MsysTechnologiesllc","followers_url":"https://api.github.com/users/MsysTechnologiesllc/followers","following_url":"https://api.github.com/users/MsysTechnologiesllc/following{/other_user}","gists_url":"https://api.github.com/users/MsysTechnologiesllc/gists{/gist_id}","starred_url":"https://api.github.com/users/MsysTechnologiesllc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MsysTechnologiesllc/subscriptions","organizations_url":"https://api.github.com/users/MsysTechnologiesllc/orgs","repos_url":"https://api.github.com/users/MsysTechnologiesllc/repos","events_url":"https://api.github.com/users/MsysTechnologiesllc/events{/privacy}","received_events_url":"https://api.github.com/users/MsysTechnologiesllc/received_events","type":"Organization","site_admin":false},"repo":{"id":25916223,"name":"azure-chef-extension","full_name":"MsysTechnologiesllc/azure-chef-extension","owner":{"login":"MsysTechnologiesllc","id":2493241,"avatar_url":"https://avatars.githubusercontent.com/u/2493241?v=3","gravatar_id":"","url":"https://api.github.com/users/MsysTechnologiesllc","html_url":"https://github.com/MsysTechnologiesllc","followers_url":"https://api.github.com/users/MsysTechnologiesllc/followers","following_url":"https://api.github.com/users/MsysTechnologiesllc/following{/other_user}","gists_url":"https://api.github.com/users/MsysTechnologiesllc/gists{/gist_id}","starred_url":"https://api.github.com/users/MsysTechnologiesllc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MsysTechnologiesllc/subscriptions","organizations_url":"https://api.github.com/users/MsysTechnologiesllc/orgs","repos_url":"https://api.github.com/users/MsysTechnologiesllc/repos","events_url":"https://api.github.com/users/MsysTechnologiesllc/events{/privacy}","received_events_url":"https://api.github.com/users/MsysTechnologiesllc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MsysTechnologiesllc/azure-chef-extension","description":"","fork":true,"url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension","forks_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/forks","keys_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/teams","hooks_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/hooks","issue_events_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/issues/events{/number}","events_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/events","assignees_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/assignees{/user}","branches_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/branches{/branch}","tags_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/tags","blobs_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/git/refs{/sha}","trees_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/statuses/{sha}","languages_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/languages","stargazers_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/stargazers","contributors_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/contributors","subscribers_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/subscribers","subscription_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/subscription","commits_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/commits{/sha}","git_commits_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/git/commits{/sha}","comments_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/comments{/number}","issue_comment_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/issues/comments{/number}","contents_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/contents/{+path}","compare_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/merges","archive_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/downloads","issues_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/issues{/number}","pulls_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/pulls{/number}","milestones_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/milestones{/number}","notifications_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/labels{/name}","releases_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/releases{/id}","deployments_url":"https://api.github.com/repos/MsysTechnologiesllc/azure-chef-extension/deployments","created_at":"2014-10-29T10:43:56Z","updated_at":"2016-01-12T12:51:48Z","pushed_at":"2016-08-23T05:27:40Z","git_url":"git://github.com/MsysTechnologiesllc/azure-chef-extension.git","ssh_url":"git@github.com:MsysTechnologiesllc/azure-chef-extension.git","clone_url":"https://github.com/MsysTechnologiesllc/azure-chef-extension.git","svn_url":"https://github.com/MsysTechnologiesllc/azure-chef-extension","homepage":null,"size":733,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"master"}},"base":{"label":"chef-partners:master","ref":"master","sha":"d803c0cdb1653e4a907ce6c6cfb295f92835eeb9","user":{"login":"chef-partners","id":6988876,"avatar_url":"https://avatars.githubusercontent.com/u/6988876?v=3","gravatar_id":"","url":"https://api.github.com/users/chef-partners","html_url":"https://github.com/chef-partners","followers_url":"https://api.github.com/users/chef-partners/followers","following_url":"https://api.github.com/users/chef-partners/following{/other_user}","gists_url":"https://api.github.com/users/chef-partners/gists{/gist_id}","starred_url":"https://api.github.com/users/chef-partners/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef-partners/subscriptions","organizations_url":"https://api.github.com/users/chef-partners/orgs","repos_url":"https://api.github.com/users/chef-partners/repos","events_url":"https://api.github.com/users/chef-partners/events{/privacy}","received_events_url":"https://api.github.com/users/chef-partners/received_events","type":"Organization","site_admin":false},"repo":{"id":25906808,"name":"azure-chef-extension","full_name":"chef-partners/azure-chef-extension","owner":{"login":"chef-partners","id":6988876,"avatar_url":"https://avatars.githubusercontent.com/u/6988876?v=3","gravatar_id":"","url":"https://api.github.com/users/chef-partners","html_url":"https://github.com/chef-partners","followers_url":"https://api.github.com/users/chef-partners/followers","following_url":"https://api.github.com/users/chef-partners/following{/other_user}","gists_url":"https://api.github.com/users/chef-partners/gists{/gist_id}","starred_url":"https://api.github.com/users/chef-partners/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef-partners/subscriptions","organizations_url":"https://api.github.com/users/chef-partners/orgs","repos_url":"https://api.github.com/users/chef-partners/repos","events_url":"https://api.github.com/users/chef-partners/events{/privacy}","received_events_url":"https://api.github.com/users/chef-partners/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef-partners/azure-chef-extension","description":"The development repository for the Chef Extension available through Azure","fork":false,"url":"https://api.github.com/repos/chef-partners/azure-chef-extension","forks_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/forks","keys_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/teams","hooks_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/hooks","issue_events_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/issues/events{/number}","events_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/events","assignees_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/assignees{/user}","branches_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/branches{/branch}","tags_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/tags","blobs_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/statuses/{sha}","languages_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/languages","stargazers_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/stargazers","contributors_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/contributors","subscribers_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/subscribers","subscription_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/subscription","commits_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/contents/{+path}","compare_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/merges","archive_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/downloads","issues_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/issues{/number}","pulls_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/pulls{/number}","milestones_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/milestones{/number}","notifications_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/labels{/name}","releases_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/releases{/id}","deployments_url":"https://api.github.com/repos/chef-partners/azure-chef-extension/deployments","created_at":"2014-10-29T05:59:11Z","updated_at":"2016-08-03T23:01:57Z","pushed_at":"2016-08-23T05:27:40Z","git_url":"git://github.com/chef-partners/azure-chef-extension.git","ssh_url":"git@github.com:chef-partners/azure-chef-extension.git","clone_url":"https://github.com/chef-partners/azure-chef-extension.git","svn_url":"https://github.com/chef-partners/azure-chef-extension","homepage":"","size":756,"stargazers_count":14,"watchers_count":14,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":26,"forks":10,"open_issues":26,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef-partners/azure-chef-extension/pulls/161"},"html":{"href":"https://github.com/chef-partners/azure-chef-extension/pull/161"},"issue":{"href":"https://api.github.com/repos/chef-partners/azure-chef-extension/issues/161"},"comments":{"href":"https://api.github.com/repos/chef-partners/azure-chef-extension/issues/161/comments"},"review_comments":{"href":"https://api.github.com/repos/chef-partners/azure-chef-extension/pulls/161/comments"},"review_comment":{"href":"https://api.github.com/repos/chef-partners/azure-chef-extension/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chef-partners/azure-chef-extension/pulls/161/commits"},"statuses":{"href":"https://api.github.com/repos/chef-partners/azure-chef-extension/statuses/127d1ea60b3832bc4aa3be39ec504b8b51e58914"}}}}
{"actor":{"display_login":"mwrock"}}