{"action":"created","comment":{"url":"https://api.github.com/repos/GLab/ToMaTo/pulls/comments/50398020","id":50398020,"diff_hunk":"@@ -175,27 +177,34 @@ def incrementErrors(self):\n \tdef update(self):\n \t\tself.availability *= config.HOST_AVAILABILITY_FACTOR\n \t\tself.save()\n+\t\t\n \t\tif not self.enabled:\n \t\t\treturn\n \t\tbefore = time.time()\n-\t\tself.hostInfo = self._info()\n-\t\tafter = time.time()\n-\t\tself.hostInfoTimestamp = (before + after) / 2.0\n-\t\tself.hostInfo[\"query_time\"] = after - before\n-\t\tself.hostInfo[\"time_diff\"] = self.hostInfo[\"time\"] - self.hostInfoTimestamp\n+\t\t\n+\t\t\n \t\ttry:\n+\t\t\tself.hostInfo = self._info()\n+\t\t\tself.synchronized = True\n+\t\t\n+\t\t\tafter = time.time()\n+\t\t\tself.hostInfoTimestamp = (before + after) / 2.0\n+\t\t\tself.hostInfo[\"query_time\"] = after - before\n+\t\t\tself.hostInfo[\"time_diff\"] = self.hostInfo[\"time\"] - self.hostInfoTimestamp\n \t\t\tself.hostNetworks = self.getProxy().host_networks()\n+\t\t\tcaps = self._convertCapabilities(self.getProxy().host_capabilities())\n+\t\t\tself.elementTypes = caps[\"elements\"]\n+\t\t\tself.connectionTypes = caps[\"connections\"]\n+\t\t\tself.componentErrors = max(0, self.componentErrors / 2)\n+\t\t\tif not self.problems():\n+\t\t\t\tself.availability += 1.0 - config.HOST_AVAILABILITY_FACTOR\n+\t\t\tself.save()\n+\t\t\tlogging.logMessage(\"info\", category=\"host\", name=self.name, info=self.hostInfo)\n+\t\t\tlogging.logMessage(\"capabilities\", category=\"host\", name=self.name, capabilities=caps)\n \t\texcept:\n-\t\t\tself.hostNetworks = []\n-\t\tcaps = self._convertCapabilities(self.getProxy().host_capabilities())\n-\t\tself.elementTypes = caps[\"elements\"]\n-\t\tself.connectionTypes = caps[\"connections\"]\n-\t\tself.componentErrors = max(0, self.componentErrors / 2)\n-\t\tif not self.problems():\n-\t\t\tself.availability += 1.0 - config.HOST_AVAILABILITY_FACTOR\n-\t\tself.save()\n-\t\tlogging.logMessage(\"info\", category=\"host\", name=self.name, info=self.hostInfo)\n-\t\tlogging.logMessage(\"capabilities\", category=\"host\", name=self.name, capabilities=caps)\n+\t\t\tself.synchronized = False","path":"backend/tomato/host/__init__.py","position":62,"original_position":62,"commit_id":"b33324788f4643129547fb4db23d3b1484e21bcd","original_commit_id":"b33324788f4643129547fb4db23d3b1484e21bcd","user":{"login":"t-gerhard","id":986924,"avatar_url":"https://avatars.githubusercontent.com/u/986924?v=3","gravatar_id":"","url":"https://api.github.com/users/t-gerhard","html_url":"https://github.com/t-gerhard","followers_url":"https://api.github.com/users/t-gerhard/followers","following_url":"https://api.github.com/users/t-gerhard/following{/other_user}","gists_url":"https://api.github.com/users/t-gerhard/gists{/gist_id}","starred_url":"https://api.github.com/users/t-gerhard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t-gerhard/subscriptions","organizations_url":"https://api.github.com/users/t-gerhard/orgs","repos_url":"https://api.github.com/users/t-gerhard/repos","events_url":"https://api.github.com/users/t-gerhard/events{/privacy}","received_events_url":"https://api.github.com/users/t-gerhard/received_events","type":"User","site_admin":false},"body":"You should raise the exception after setting the flag to keep the original semantics.","created_at":"2016-01-21T13:10:01Z","updated_at":"2016-01-21T13:10:01Z","html_url":"https://github.com/GLab/ToMaTo/pull/1112#discussion_r50398020","pull_request_url":"https://api.github.com/repos/GLab/ToMaTo/pulls/1112","_links":{"self":{"href":"https://api.github.com/repos/GLab/ToMaTo/pulls/comments/50398020"},"html":{"href":"https://github.com/GLab/ToMaTo/pull/1112#discussion_r50398020"},"pull_request":{"href":"https://api.github.com/repos/GLab/ToMaTo/pulls/1112"}}},"pull_request":{"url":"https://api.github.com/repos/GLab/ToMaTo/pulls/1112","id":50231981,"html_url":"https://github.com/GLab/ToMaTo/pull/1112","diff_url":"https://github.com/GLab/ToMaTo/pull/1112.diff","patch_url":"https://github.com/GLab/ToMaTo/pull/1112.patch","issue_url":"https://api.github.com/repos/GLab/ToMaTo/issues/1112","number":1112,"state":"open","locked":false,"title":"Added forced Host update button to webfrontend","user":{"login":"swuest","id":5919623,"avatar_url":"https://avatars.githubusercontent.com/u/5919623?v=3","gravatar_id":"","url":"https://api.github.com/users/swuest","html_url":"https://github.com/swuest","followers_url":"https://api.github.com/users/swuest/followers","following_url":"https://api.github.com/users/swuest/following{/other_user}","gists_url":"https://api.github.com/users/swuest/gists{/gist_id}","starred_url":"https://api.github.com/users/swuest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swuest/subscriptions","organizations_url":"https://api.github.com/users/swuest/orgs","repos_url":"https://api.github.com/users/swuest/repos","events_url":"https://api.github.com/users/swuest/events{/privacy}","received_events_url":"https://api.github.com/users/swuest/received_events","type":"User","site_admin":false},"body":"Works and was tested in Firefox and Chrome. It also should updated host_list and host_info in the cache, but I have no clue why this won't work. But it is not a bug or a real problem for this feature and can be solved in a different issue.\r\n\r\nCloses #996 \r\n\r\n","created_at":"2015-11-10T09:39:12Z","updated_at":"2016-01-21T13:10:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d7eb1af0faf97193546b5edacd6be9e70388af9a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GLab/ToMaTo/pulls/1112/commits","review_comments_url":"https://api.github.com/repos/GLab/ToMaTo/pulls/1112/comments","review_comment_url":"https://api.github.com/repos/GLab/ToMaTo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GLab/ToMaTo/issues/1112/comments","statuses_url":"https://api.github.com/repos/GLab/ToMaTo/statuses/b33324788f4643129547fb4db23d3b1484e21bcd","head":{"label":"swuest:host_update","ref":"host_update","sha":"b33324788f4643129547fb4db23d3b1484e21bcd","user":{"login":"swuest","id":5919623,"avatar_url":"https://avatars.githubusercontent.com/u/5919623?v=3","gravatar_id":"","url":"https://api.github.com/users/swuest","html_url":"https://github.com/swuest","followers_url":"https://api.github.com/users/swuest/followers","following_url":"https://api.github.com/users/swuest/following{/other_user}","gists_url":"https://api.github.com/users/swuest/gists{/gist_id}","starred_url":"https://api.github.com/users/swuest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swuest/subscriptions","organizations_url":"https://api.github.com/users/swuest/orgs","repos_url":"https://api.github.com/users/swuest/repos","events_url":"https://api.github.com/users/swuest/events{/privacy}","received_events_url":"https://api.github.com/users/swuest/received_events","type":"User","site_admin":false},"repo":{"id":14718797,"name":"ToMaTo","full_name":"swuest/ToMaTo","owner":{"login":"swuest","id":5919623,"avatar_url":"https://avatars.githubusercontent.com/u/5919623?v=3","gravatar_id":"","url":"https://api.github.com/users/swuest","html_url":"https://github.com/swuest","followers_url":"https://api.github.com/users/swuest/followers","following_url":"https://api.github.com/users/swuest/following{/other_user}","gists_url":"https://api.github.com/users/swuest/gists{/gist_id}","starred_url":"https://api.github.com/users/swuest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swuest/subscriptions","organizations_url":"https://api.github.com/users/swuest/orgs","repos_url":"https://api.github.com/users/swuest/repos","events_url":"https://api.github.com/users/swuest/events{/privacy}","received_events_url":"https://api.github.com/users/swuest/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/swuest/ToMaTo","description":"German-Lab ToMaTo","fork":true,"url":"https://api.github.com/repos/swuest/ToMaTo","forks_url":"https://api.github.com/repos/swuest/ToMaTo/forks","keys_url":"https://api.github.com/repos/swuest/ToMaTo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swuest/ToMaTo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swuest/ToMaTo/teams","hooks_url":"https://api.github.com/repos/swuest/ToMaTo/hooks","issue_events_url":"https://api.github.com/repos/swuest/ToMaTo/issues/events{/number}","events_url":"https://api.github.com/repos/swuest/ToMaTo/events","assignees_url":"https://api.github.com/repos/swuest/ToMaTo/assignees{/user}","branches_url":"https://api.github.com/repos/swuest/ToMaTo/branches{/branch}","tags_url":"https://api.github.com/repos/swuest/ToMaTo/tags","blobs_url":"https://api.github.com/repos/swuest/ToMaTo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swuest/ToMaTo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swuest/ToMaTo/git/refs{/sha}","trees_url":"https://api.github.com/repos/swuest/ToMaTo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swuest/ToMaTo/statuses/{sha}","languages_url":"https://api.github.com/repos/swuest/ToMaTo/languages","stargazers_url":"https://api.github.com/repos/swuest/ToMaTo/stargazers","contributors_url":"https://api.github.com/repos/swuest/ToMaTo/contributors","subscribers_url":"https://api.github.com/repos/swuest/ToMaTo/subscribers","subscription_url":"https://api.github.com/repos/swuest/ToMaTo/subscription","commits_url":"https://api.github.com/repos/swuest/ToMaTo/commits{/sha}","git_commits_url":"https://api.github.com/repos/swuest/ToMaTo/git/commits{/sha}","comments_url":"https://api.github.com/repos/swuest/ToMaTo/comments{/number}","issue_comment_url":"https://api.github.com/repos/swuest/ToMaTo/issues/comments{/number}","contents_url":"https://api.github.com/repos/swuest/ToMaTo/contents/{+path}","compare_url":"https://api.github.com/repos/swuest/ToMaTo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swuest/ToMaTo/merges","archive_url":"https://api.github.com/repos/swuest/ToMaTo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swuest/ToMaTo/downloads","issues_url":"https://api.github.com/repos/swuest/ToMaTo/issues{/number}","pulls_url":"https://api.github.com/repos/swuest/ToMaTo/pulls{/number}","milestones_url":"https://api.github.com/repos/swuest/ToMaTo/milestones{/number}","notifications_url":"https://api.github.com/repos/swuest/ToMaTo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swuest/ToMaTo/labels{/name}","releases_url":"https://api.github.com/repos/swuest/ToMaTo/releases{/id}","created_at":"2013-11-26T14:17:05Z","updated_at":"2015-04-24T09:10:23Z","pushed_at":"2015-12-01T14:01:59Z","git_url":"git://github.com/swuest/ToMaTo.git","ssh_url":"git@github.com:swuest/ToMaTo.git","clone_url":"https://github.com/swuest/ToMaTo.git","svn_url":"https://github.com/swuest/ToMaTo","homepage":"http://glab.github.com/ToMaTo/","size":52462,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"GLab:master","ref":"master","sha":"168d0d597a1aded91593086af4decaa0047ff4ae","user":{"login":"GLab","id":1026834,"avatar_url":"https://avatars.githubusercontent.com/u/1026834?v=3","gravatar_id":"","url":"https://api.github.com/users/GLab","html_url":"https://github.com/GLab","followers_url":"https://api.github.com/users/GLab/followers","following_url":"https://api.github.com/users/GLab/following{/other_user}","gists_url":"https://api.github.com/users/GLab/gists{/gist_id}","starred_url":"https://api.github.com/users/GLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GLab/subscriptions","organizations_url":"https://api.github.com/users/GLab/orgs","repos_url":"https://api.github.com/users/GLab/repos","events_url":"https://api.github.com/users/GLab/events{/privacy}","received_events_url":"https://api.github.com/users/GLab/received_events","type":"Organization","site_admin":false},"repo":{"id":1867451,"name":"ToMaTo","full_name":"GLab/ToMaTo","owner":{"login":"GLab","id":1026834,"avatar_url":"https://avatars.githubusercontent.com/u/1026834?v=3","gravatar_id":"","url":"https://api.github.com/users/GLab","html_url":"https://github.com/GLab","followers_url":"https://api.github.com/users/GLab/followers","following_url":"https://api.github.com/users/GLab/following{/other_user}","gists_url":"https://api.github.com/users/GLab/gists{/gist_id}","starred_url":"https://api.github.com/users/GLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GLab/subscriptions","organizations_url":"https://api.github.com/users/GLab/orgs","repos_url":"https://api.github.com/users/GLab/repos","events_url":"https://api.github.com/users/GLab/events{/privacy}","received_events_url":"https://api.github.com/users/GLab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GLab/ToMaTo","description":"German-Lab ToMaTo","fork":false,"url":"https://api.github.com/repos/GLab/ToMaTo","forks_url":"https://api.github.com/repos/GLab/ToMaTo/forks","keys_url":"https://api.github.com/repos/GLab/ToMaTo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GLab/ToMaTo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GLab/ToMaTo/teams","hooks_url":"https://api.github.com/repos/GLab/ToMaTo/hooks","issue_events_url":"https://api.github.com/repos/GLab/ToMaTo/issues/events{/number}","events_url":"https://api.github.com/repos/GLab/ToMaTo/events","assignees_url":"https://api.github.com/repos/GLab/ToMaTo/assignees{/user}","branches_url":"https://api.github.com/repos/GLab/ToMaTo/branches{/branch}","tags_url":"https://api.github.com/repos/GLab/ToMaTo/tags","blobs_url":"https://api.github.com/repos/GLab/ToMaTo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GLab/ToMaTo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GLab/ToMaTo/git/refs{/sha}","trees_url":"https://api.github.com/repos/GLab/ToMaTo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GLab/ToMaTo/statuses/{sha}","languages_url":"https://api.github.com/repos/GLab/ToMaTo/languages","stargazers_url":"https://api.github.com/repos/GLab/ToMaTo/stargazers","contributors_url":"https://api.github.com/repos/GLab/ToMaTo/contributors","subscribers_url":"https://api.github.com/repos/GLab/ToMaTo/subscribers","subscription_url":"https://api.github.com/repos/GLab/ToMaTo/subscription","commits_url":"https://api.github.com/repos/GLab/ToMaTo/commits{/sha}","git_commits_url":"https://api.github.com/repos/GLab/ToMaTo/git/commits{/sha}","comments_url":"https://api.github.com/repos/GLab/ToMaTo/comments{/number}","issue_comment_url":"https://api.github.com/repos/GLab/ToMaTo/issues/comments{/number}","contents_url":"https://api.github.com/repos/GLab/ToMaTo/contents/{+path}","compare_url":"https://api.github.com/repos/GLab/ToMaTo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GLab/ToMaTo/merges","archive_url":"https://api.github.com/repos/GLab/ToMaTo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GLab/ToMaTo/downloads","issues_url":"https://api.github.com/repos/GLab/ToMaTo/issues{/number}","pulls_url":"https://api.github.com/repos/GLab/ToMaTo/pulls{/number}","milestones_url":"https://api.github.com/repos/GLab/ToMaTo/milestones{/number}","notifications_url":"https://api.github.com/repos/GLab/ToMaTo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GLab/ToMaTo/labels{/name}","releases_url":"https://api.github.com/repos/GLab/ToMaTo/releases{/id}","created_at":"2011-06-08T20:17:45Z","updated_at":"2015-06-26T17:56:10Z","pushed_at":"2016-01-21T11:10:15Z","git_url":"git://github.com/GLab/ToMaTo.git","ssh_url":"git@github.com:GLab/ToMaTo.git","clone_url":"https://github.com/GLab/ToMaTo.git","svn_url":"https://github.com/GLab/ToMaTo","homepage":"http://www.tomato-lab.org","size":64685,"stargazers_count":23,"watchers_count":23,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":107,"forks":10,"open_issues":107,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GLab/ToMaTo/pulls/1112"},"html":{"href":"https://github.com/GLab/ToMaTo/pull/1112"},"issue":{"href":"https://api.github.com/repos/GLab/ToMaTo/issues/1112"},"comments":{"href":"https://api.github.com/repos/GLab/ToMaTo/issues/1112/comments"},"review_comments":{"href":"https://api.github.com/repos/GLab/ToMaTo/pulls/1112/comments"},"review_comment":{"href":"https://api.github.com/repos/GLab/ToMaTo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GLab/ToMaTo/pulls/1112/commits"},"statuses":{"href":"https://api.github.com/repos/GLab/ToMaTo/statuses/b33324788f4643129547fb4db23d3b1484e21bcd"}}}}