{"action":"created","comment":{"url":"https://api.github.com/repos/Icinga/icinga2/pulls/comments/115984026","pull_request_review_id":37568905,"id":115984026,"diff_hunk":"@@ -112,9 +118,24 @@ bool ConfigObjectUtility::CreateObject(const Type::Ptr& type, const String& full\n \tString path = GetObjectConfigPath(type, fullName);\n \tUtility::MkDirP(Utility::DirName(path), 0700);\n \n-\tif (Utility::PathExists(path)) {\n-\t\terrors->Add(\"Configuration file '\" + path + \"' already exists.\");\n-\t\treturn false;\n+\t{\n+\n+#ifdef _WIN32\n+#define stat _stat\n+#endif /* _WIN32 */\n+\n+\t\tstruct stat stats;\n+\n+\t\tif (stat(path.CStr(), &stats)) {\n+\t\t\tif (errno != ENOENT)\n+\t\t\t\tBOOST_THROW_EXCEPTION(posix_error()\n+\t\t\t\t    << boost::errinfo_api_function(\"stat\")\n+\t\t\t\t    << boost::errinfo_errno(errno)\n+\t\t\t\t    << boost::errinfo_file_name(path));\n+\t\t} else if (stats.st_size) {\n+\t\t\terrors->Add(\"Configuration file '\" + path + \"' already exists.\");\n+\t\t\treturn false;\n+\t\t}","path":"lib/remote/configobjectutility.cpp","position":37,"original_position":37,"commit_id":"0b9cd83764ada8402418c7e07d9ef54ec83f6609","original_commit_id":"0b9cd83764ada8402418c7e07d9ef54ec83f6609","user":{"login":"Al2Klimov","id":6053266,"avatar_url":"https://avatars3.githubusercontent.com/u/6053266?v=3","gravatar_id":"","url":"https://api.github.com/users/Al2Klimov","html_url":"https://github.com/Al2Klimov","followers_url":"https://api.github.com/users/Al2Klimov/followers","following_url":"https://api.github.com/users/Al2Klimov/following{/other_user}","gists_url":"https://api.github.com/users/Al2Klimov/gists{/gist_id}","starred_url":"https://api.github.com/users/Al2Klimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Al2Klimov/subscriptions","organizations_url":"https://api.github.com/users/Al2Klimov/orgs","repos_url":"https://api.github.com/users/Al2Klimov/repos","events_url":"https://api.github.com/users/Al2Klimov/events{/privacy}","received_events_url":"https://api.github.com/users/Al2Klimov/received_events","type":"User","site_admin":false},"body":"I think I'll wait for #5220.","created_at":"2017-05-11T13:05:15Z","updated_at":"2017-05-11T13:05:15Z","html_url":"https://github.com/Icinga/icinga2/pull/5221#discussion_r115984026","pull_request_url":"https://api.github.com/repos/Icinga/icinga2/pulls/5221","_links":{"self":{"href":"https://api.github.com/repos/Icinga/icinga2/pulls/comments/115984026"},"html":{"href":"https://github.com/Icinga/icinga2/pull/5221#discussion_r115984026"},"pull_request":{"href":"https://api.github.com/repos/Icinga/icinga2/pulls/5221"}}},"pull_request":{"url":"https://api.github.com/repos/Icinga/icinga2/pulls/5221","id":118798303,"html_url":"https://github.com/Icinga/icinga2/pull/5221","diff_url":"https://github.com/Icinga/icinga2/pull/5221.diff","patch_url":"https://github.com/Icinga/icinga2/pull/5221.patch","issue_url":"https://api.github.com/repos/Icinga/icinga2/issues/5221","number":5221,"state":"open","locked":false,"title":"ConfigObjectUtility::CreateObject(): ignore empty files","user":{"login":"Al2Klimov","id":6053266,"avatar_url":"https://avatars3.githubusercontent.com/u/6053266?v=3","gravatar_id":"","url":"https://api.github.com/users/Al2Klimov","html_url":"https://github.com/Al2Klimov","followers_url":"https://api.github.com/users/Al2Klimov/followers","following_url":"https://api.github.com/users/Al2Klimov/following{/other_user}","gists_url":"https://api.github.com/users/Al2Klimov/gists{/gist_id}","starred_url":"https://api.github.com/users/Al2Klimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Al2Klimov/subscriptions","organizations_url":"https://api.github.com/users/Al2Klimov/orgs","repos_url":"https://api.github.com/users/Al2Klimov/repos","events_url":"https://api.github.com/users/Al2Klimov/events{/privacy}","received_events_url":"https://api.github.com/users/Al2Klimov/received_events","type":"User","site_admin":false},"body":"fixes #3937","created_at":"2017-05-03T16:08:16Z","updated_at":"2017-05-11T13:05:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a2dd58d298260f165f16ef14a275cef0ca26184c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Icinga/icinga2/pulls/5221/commits","review_comments_url":"https://api.github.com/repos/Icinga/icinga2/pulls/5221/comments","review_comment_url":"https://api.github.com/repos/Icinga/icinga2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Icinga/icinga2/issues/5221/comments","statuses_url":"https://api.github.com/repos/Icinga/icinga2/statuses/0b9cd83764ada8402418c7e07d9ef54ec83f6609","head":{"label":"Al2Klimov:bugfix/put-request-fails-0-byte-file","ref":"bugfix/put-request-fails-0-byte-file","sha":"0b9cd83764ada8402418c7e07d9ef54ec83f6609","user":{"login":"Al2Klimov","id":6053266,"avatar_url":"https://avatars3.githubusercontent.com/u/6053266?v=3","gravatar_id":"","url":"https://api.github.com/users/Al2Klimov","html_url":"https://github.com/Al2Klimov","followers_url":"https://api.github.com/users/Al2Klimov/followers","following_url":"https://api.github.com/users/Al2Klimov/following{/other_user}","gists_url":"https://api.github.com/users/Al2Klimov/gists{/gist_id}","starred_url":"https://api.github.com/users/Al2Klimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Al2Klimov/subscriptions","organizations_url":"https://api.github.com/users/Al2Klimov/orgs","repos_url":"https://api.github.com/users/Al2Klimov/repos","events_url":"https://api.github.com/users/Al2Klimov/events{/privacy}","received_events_url":"https://api.github.com/users/Al2Klimov/received_events","type":"User","site_admin":false},"repo":{"id":81442173,"name":"icinga2","full_name":"Al2Klimov/icinga2","owner":{"login":"Al2Klimov","id":6053266,"avatar_url":"https://avatars3.githubusercontent.com/u/6053266?v=3","gravatar_id":"","url":"https://api.github.com/users/Al2Klimov","html_url":"https://github.com/Al2Klimov","followers_url":"https://api.github.com/users/Al2Klimov/followers","following_url":"https://api.github.com/users/Al2Klimov/following{/other_user}","gists_url":"https://api.github.com/users/Al2Klimov/gists{/gist_id}","starred_url":"https://api.github.com/users/Al2Klimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Al2Klimov/subscriptions","organizations_url":"https://api.github.com/users/Al2Klimov/orgs","repos_url":"https://api.github.com/users/Al2Klimov/repos","events_url":"https://api.github.com/users/Al2Klimov/events{/privacy}","received_events_url":"https://api.github.com/users/Al2Klimov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Al2Klimov/icinga2","description":"Monitoring core with features and REST API","fork":true,"url":"https://api.github.com/repos/Al2Klimov/icinga2","forks_url":"https://api.github.com/repos/Al2Klimov/icinga2/forks","keys_url":"https://api.github.com/repos/Al2Klimov/icinga2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Al2Klimov/icinga2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Al2Klimov/icinga2/teams","hooks_url":"https://api.github.com/repos/Al2Klimov/icinga2/hooks","issue_events_url":"https://api.github.com/repos/Al2Klimov/icinga2/issues/events{/number}","events_url":"https://api.github.com/repos/Al2Klimov/icinga2/events","assignees_url":"https://api.github.com/repos/Al2Klimov/icinga2/assignees{/user}","branches_url":"https://api.github.com/repos/Al2Klimov/icinga2/branches{/branch}","tags_url":"https://api.github.com/repos/Al2Klimov/icinga2/tags","blobs_url":"https://api.github.com/repos/Al2Klimov/icinga2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Al2Klimov/icinga2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Al2Klimov/icinga2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Al2Klimov/icinga2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Al2Klimov/icinga2/statuses/{sha}","languages_url":"https://api.github.com/repos/Al2Klimov/icinga2/languages","stargazers_url":"https://api.github.com/repos/Al2Klimov/icinga2/stargazers","contributors_url":"https://api.github.com/repos/Al2Klimov/icinga2/contributors","subscribers_url":"https://api.github.com/repos/Al2Klimov/icinga2/subscribers","subscription_url":"https://api.github.com/repos/Al2Klimov/icinga2/subscription","commits_url":"https://api.github.com/repos/Al2Klimov/icinga2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Al2Klimov/icinga2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Al2Klimov/icinga2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Al2Klimov/icinga2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Al2Klimov/icinga2/contents/{+path}","compare_url":"https://api.github.com/repos/Al2Klimov/icinga2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Al2Klimov/icinga2/merges","archive_url":"https://api.github.com/repos/Al2Klimov/icinga2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Al2Klimov/icinga2/downloads","issues_url":"https://api.github.com/repos/Al2Klimov/icinga2/issues{/number}","pulls_url":"https://api.github.com/repos/Al2Klimov/icinga2/pulls{/number}","milestones_url":"https://api.github.com/repos/Al2Klimov/icinga2/milestones{/number}","notifications_url":"https://api.github.com/repos/Al2Klimov/icinga2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Al2Klimov/icinga2/labels{/name}","releases_url":"https://api.github.com/repos/Al2Klimov/icinga2/releases{/id}","deployments_url":"https://api.github.com/repos/Al2Klimov/icinga2/deployments","created_at":"2017-02-09T11:12:51Z","updated_at":"2017-02-09T11:12:56Z","pushed_at":"2017-05-05T15:32:17Z","git_url":"git://github.com/Al2Klimov/icinga2.git","ssh_url":"git@github.com:Al2Klimov/icinga2.git","clone_url":"https://github.com/Al2Klimov/icinga2.git","svn_url":"https://github.com/Al2Klimov/icinga2","homepage":"https://www.icinga.com/products/icinga-2/","size":30400,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"Icinga:master","ref":"master","sha":"922cb375a95b0bcabcca990e0aa3e042831f07e8","user":{"login":"Icinga","id":835441,"avatar_url":"https://avatars0.githubusercontent.com/u/835441?v=3","gravatar_id":"","url":"https://api.github.com/users/Icinga","html_url":"https://github.com/Icinga","followers_url":"https://api.github.com/users/Icinga/followers","following_url":"https://api.github.com/users/Icinga/following{/other_user}","gists_url":"https://api.github.com/users/Icinga/gists{/gist_id}","starred_url":"https://api.github.com/users/Icinga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Icinga/subscriptions","organizations_url":"https://api.github.com/users/Icinga/orgs","repos_url":"https://api.github.com/users/Icinga/repos","events_url":"https://api.github.com/users/Icinga/events{/privacy}","received_events_url":"https://api.github.com/users/Icinga/received_events","type":"Organization","site_admin":false},"repo":{"id":12440855,"name":"icinga2","full_name":"Icinga/icinga2","owner":{"login":"Icinga","id":835441,"avatar_url":"https://avatars0.githubusercontent.com/u/835441?v=3","gravatar_id":"","url":"https://api.github.com/users/Icinga","html_url":"https://github.com/Icinga","followers_url":"https://api.github.com/users/Icinga/followers","following_url":"https://api.github.com/users/Icinga/following{/other_user}","gists_url":"https://api.github.com/users/Icinga/gists{/gist_id}","starred_url":"https://api.github.com/users/Icinga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Icinga/subscriptions","organizations_url":"https://api.github.com/users/Icinga/orgs","repos_url":"https://api.github.com/users/Icinga/repos","events_url":"https://api.github.com/users/Icinga/events{/privacy}","received_events_url":"https://api.github.com/users/Icinga/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Icinga/icinga2","description":"Monitoring core with features and REST API","fork":false,"url":"https://api.github.com/repos/Icinga/icinga2","forks_url":"https://api.github.com/repos/Icinga/icinga2/forks","keys_url":"https://api.github.com/repos/Icinga/icinga2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Icinga/icinga2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Icinga/icinga2/teams","hooks_url":"https://api.github.com/repos/Icinga/icinga2/hooks","issue_events_url":"https://api.github.com/repos/Icinga/icinga2/issues/events{/number}","events_url":"https://api.github.com/repos/Icinga/icinga2/events","assignees_url":"https://api.github.com/repos/Icinga/icinga2/assignees{/user}","branches_url":"https://api.github.com/repos/Icinga/icinga2/branches{/branch}","tags_url":"https://api.github.com/repos/Icinga/icinga2/tags","blobs_url":"https://api.github.com/repos/Icinga/icinga2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Icinga/icinga2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Icinga/icinga2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Icinga/icinga2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Icinga/icinga2/statuses/{sha}","languages_url":"https://api.github.com/repos/Icinga/icinga2/languages","stargazers_url":"https://api.github.com/repos/Icinga/icinga2/stargazers","contributors_url":"https://api.github.com/repos/Icinga/icinga2/contributors","subscribers_url":"https://api.github.com/repos/Icinga/icinga2/subscribers","subscription_url":"https://api.github.com/repos/Icinga/icinga2/subscription","commits_url":"https://api.github.com/repos/Icinga/icinga2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Icinga/icinga2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Icinga/icinga2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Icinga/icinga2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Icinga/icinga2/contents/{+path}","compare_url":"https://api.github.com/repos/Icinga/icinga2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Icinga/icinga2/merges","archive_url":"https://api.github.com/repos/Icinga/icinga2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Icinga/icinga2/downloads","issues_url":"https://api.github.com/repos/Icinga/icinga2/issues{/number}","pulls_url":"https://api.github.com/repos/Icinga/icinga2/pulls{/number}","milestones_url":"https://api.github.com/repos/Icinga/icinga2/milestones{/number}","notifications_url":"https://api.github.com/repos/Icinga/icinga2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Icinga/icinga2/labels{/name}","releases_url":"https://api.github.com/repos/Icinga/icinga2/releases{/id}","deployments_url":"https://api.github.com/repos/Icinga/icinga2/deployments","created_at":"2013-08-28T18:02:06Z","updated_at":"2017-05-11T12:48:45Z","pushed_at":"2017-05-11T12:46:25Z","git_url":"git://github.com/Icinga/icinga2.git","ssh_url":"git@github.com:Icinga/icinga2.git","clone_url":"https://github.com/Icinga/icinga2.git","svn_url":"https://github.com/Icinga/icinga2","homepage":"https://www.icinga.com/products/icinga-2/","size":30542,"stargazers_count":629,"watchers_count":629,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":237,"mirror_url":null,"open_issues_count":366,"forks":237,"open_issues":366,"watchers":629,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Icinga/icinga2/pulls/5221"},"html":{"href":"https://github.com/Icinga/icinga2/pull/5221"},"issue":{"href":"https://api.github.com/repos/Icinga/icinga2/issues/5221"},"comments":{"href":"https://api.github.com/repos/Icinga/icinga2/issues/5221/comments"},"review_comments":{"href":"https://api.github.com/repos/Icinga/icinga2/pulls/5221/comments"},"review_comment":{"href":"https://api.github.com/repos/Icinga/icinga2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Icinga/icinga2/pulls/5221/commits"},"statuses":{"href":"https://api.github.com/repos/Icinga/icinga2/statuses/0b9cd83764ada8402418c7e07d9ef54ec83f6609"}}}}
{"actor":{"display_login":"Al2Klimov"}}