{"action":"created","comment":{"url":"https://api.github.com/repos/crate/crash/pulls/comments/70828032","id":70828032,"diff_hunk":"@@ -91,47 +91,89 @@ def __call__(self, cmd, *args, **kwargs):\n             cmd._autocomplete and 'ON' or 'OFF'\n         )\n \n-class ClusterCheckCommand(Command):\n-    \"\"\" print failed cluster checks \"\"\"\n \n-    CLUSTER_CHECK_STMT = \"\"\"\n-        SELECT description AS \"Failed checks\"\n-        FROM sys.checks\n-        WHERE passed = false \n-        ORDER BY id ASC\"\"\"\n+class CheckCommand(Command):\n \n-    @noargs_command\n-    def __call__(self, cmd, *args, **kwargs):\n-        if cmd.connection.lowest_server_version >= StrictVersion(\"0.52.0\"):\n-            self.execute(cmd)\n-        else:\n-            tmpl = 'Crate {version} does not support the cluster \"check\" command.'\n-            cmd.logger.warn(tmpl.format(version=cmd.connection.lowest_server_version))\n+    CHECK_NAME = None\n \n-    def execute(self, cmd):\n-        success = cmd._execute(ClusterCheckCommand.CLUSTER_CHECK_STMT)\n+    def execute(self, cmd, stmt):\n+        success = cmd._execute(stmt)\n         cmd.exit_code = cmd.exit_code or int(not success)\n         if not success:\n             return False\n         cur = cmd.cursor\n+        assert self.CHECK_NAME\n         print_vars = {\n             's': 'S'[cur.rowcount == 1:],\n-            'rowcount': cur.rowcount\n+            'rowcount': cur.rowcount,\n+            'check_name': self.CHECK_NAME,\n         }\n         checks = cur.fetchall()\n         if len(checks):\n             cmd.pprint(checks, [c[0] for c in cur.description])\n-            tmpl = '{rowcount} CLUSTER CHECK{s} FAILED'\n+            tmpl = '{rowcount} {check_name}{s} FAILED'\n             cmd.logger.critical(tmpl.format(**print_vars))\n         else:\n-            cmd.logger.info('CLUSTER CHECK OK')\n+            cmd.logger.info('{} OK'.format(self.CHECK_NAME))\n         return True\n \n \n+class NodeCheckCommand(CheckCommand):\n+    \"\"\" print failed node checks \"\"\"\n+\n+    DEFAULT_STMT = \"\"\"\n+        SELECT n.name AS \"Node Name\", c.description AS \"Failed Checks\"","path":"src/crate/crash/commands.py","position":54,"original_position":54,"commit_id":"79f2d9adbdfe7cc34cf8a2171404ff51021ff48e","original_commit_id":"79f2d9adbdfe7cc34cf8a2171404ff51021ff48e","user":{"login":"chaudum","id":281260,"avatar_url":"https://avatars.githubusercontent.com/u/281260?v=3","gravatar_id":"","url":"https://api.github.com/users/chaudum","html_url":"https://github.com/chaudum","followers_url":"https://api.github.com/users/chaudum/followers","following_url":"https://api.github.com/users/chaudum/following{/other_user}","gists_url":"https://api.github.com/users/chaudum/gists{/gist_id}","starred_url":"https://api.github.com/users/chaudum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chaudum/subscriptions","organizations_url":"https://api.github.com/users/chaudum/orgs","repos_url":"https://api.github.com/users/chaudum/repos","events_url":"https://api.github.com/users/chaudum/events{/privacy}","received_events_url":"https://api.github.com/users/chaudum/received_events","type":"User","site_admin":false},"body":"```AS \"Failed Check\"```","created_at":"2016-07-14T15:35:14Z","updated_at":"2016-07-14T15:35:14Z","html_url":"https://github.com/crate/crash/pull/142#discussion_r70828032","pull_request_url":"https://api.github.com/repos/crate/crash/pulls/142","_links":{"self":{"href":"https://api.github.com/repos/crate/crash/pulls/comments/70828032"},"html":{"href":"https://github.com/crate/crash/pull/142#discussion_r70828032"},"pull_request":{"href":"https://api.github.com/repos/crate/crash/pulls/142"}}},"pull_request":{"url":"https://api.github.com/repos/crate/crash/pulls/142","id":77471925,"html_url":"https://github.com/crate/crash/pull/142","diff_url":"https://github.com/crate/crash/pull/142.diff","patch_url":"https://github.com/crate/crash/pull/142.patch","issue_url":"https://api.github.com/repos/crate/crash/issues/142","number":142,"state":"open","locked":false,"title":"add the ``nodecheck`` crash command","user":{"login":"kovrus","id":7442373,"avatar_url":"https://avatars.githubusercontent.com/u/7442373?v=3","gravatar_id":"","url":"https://api.github.com/users/kovrus","html_url":"https://github.com/kovrus","followers_url":"https://api.github.com/users/kovrus/followers","following_url":"https://api.github.com/users/kovrus/following{/other_user}","gists_url":"https://api.github.com/users/kovrus/gists{/gist_id}","starred_url":"https://api.github.com/users/kovrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kovrus/subscriptions","organizations_url":"https://api.github.com/users/kovrus/orgs","repos_url":"https://api.github.com/users/kovrus/repos","events_url":"https://api.github.com/users/kovrus/events{/privacy}","received_events_url":"https://api.github.com/users/kovrus/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-14T15:05:01Z","updated_at":"2016-07-14T15:35:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bcb0e588aed3667be1de984f110f0bf5f981a428","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/crate/crash/pulls/142/commits","review_comments_url":"https://api.github.com/repos/crate/crash/pulls/142/comments","review_comment_url":"https://api.github.com/repos/crate/crash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crate/crash/issues/142/comments","statuses_url":"https://api.github.com/repos/crate/crash/statuses/79f2d9adbdfe7cc34cf8a2171404ff51021ff48e","head":{"label":"crate:nodechecks","ref":"nodechecks","sha":"79f2d9adbdfe7cc34cf8a2171404ff51021ff48e","user":{"login":"crate","id":4048232,"avatar_url":"https://avatars.githubusercontent.com/u/4048232?v=3","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"repo":{"id":17720373,"name":"crash","full_name":"crate/crash","owner":{"login":"crate","id":4048232,"avatar_url":"https://avatars.githubusercontent.com/u/4048232?v=3","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crate/crash","description":"The CRate SHell","fork":false,"url":"https://api.github.com/repos/crate/crash","forks_url":"https://api.github.com/repos/crate/crash/forks","keys_url":"https://api.github.com/repos/crate/crash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crate/crash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crate/crash/teams","hooks_url":"https://api.github.com/repos/crate/crash/hooks","issue_events_url":"https://api.github.com/repos/crate/crash/issues/events{/number}","events_url":"https://api.github.com/repos/crate/crash/events","assignees_url":"https://api.github.com/repos/crate/crash/assignees{/user}","branches_url":"https://api.github.com/repos/crate/crash/branches{/branch}","tags_url":"https://api.github.com/repos/crate/crash/tags","blobs_url":"https://api.github.com/repos/crate/crash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crate/crash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crate/crash/git/refs{/sha}","trees_url":"https://api.github.com/repos/crate/crash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crate/crash/statuses/{sha}","languages_url":"https://api.github.com/repos/crate/crash/languages","stargazers_url":"https://api.github.com/repos/crate/crash/stargazers","contributors_url":"https://api.github.com/repos/crate/crash/contributors","subscribers_url":"https://api.github.com/repos/crate/crash/subscribers","subscription_url":"https://api.github.com/repos/crate/crash/subscription","commits_url":"https://api.github.com/repos/crate/crash/commits{/sha}","git_commits_url":"https://api.github.com/repos/crate/crash/git/commits{/sha}","comments_url":"https://api.github.com/repos/crate/crash/comments{/number}","issue_comment_url":"https://api.github.com/repos/crate/crash/issues/comments{/number}","contents_url":"https://api.github.com/repos/crate/crash/contents/{+path}","compare_url":"https://api.github.com/repos/crate/crash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crate/crash/merges","archive_url":"https://api.github.com/repos/crate/crash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crate/crash/downloads","issues_url":"https://api.github.com/repos/crate/crash/issues{/number}","pulls_url":"https://api.github.com/repos/crate/crash/pulls{/number}","milestones_url":"https://api.github.com/repos/crate/crash/milestones{/number}","notifications_url":"https://api.github.com/repos/crate/crash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crate/crash/labels{/name}","releases_url":"https://api.github.com/repos/crate/crash/releases{/id}","deployments_url":"https://api.github.com/repos/crate/crash/deployments","created_at":"2014-03-13T17:52:39Z","updated_at":"2016-05-26T14:09:33Z","pushed_at":"2016-07-14T15:23:35Z","git_url":"git://github.com/crate/crash.git","ssh_url":"git@github.com:crate/crash.git","clone_url":"https://github.com/crate/crash.git","svn_url":"https://github.com/crate/crash","homepage":null,"size":399,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":4,"forks":5,"open_issues":4,"watchers":11,"default_branch":"master"}},"base":{"label":"crate:master","ref":"master","sha":"0404eabe22ff51b6952ac7400258a52c19b0e4e9","user":{"login":"crate","id":4048232,"avatar_url":"https://avatars.githubusercontent.com/u/4048232?v=3","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"repo":{"id":17720373,"name":"crash","full_name":"crate/crash","owner":{"login":"crate","id":4048232,"avatar_url":"https://avatars.githubusercontent.com/u/4048232?v=3","gravatar_id":"","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crate/crash","description":"The CRate SHell","fork":false,"url":"https://api.github.com/repos/crate/crash","forks_url":"https://api.github.com/repos/crate/crash/forks","keys_url":"https://api.github.com/repos/crate/crash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crate/crash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crate/crash/teams","hooks_url":"https://api.github.com/repos/crate/crash/hooks","issue_events_url":"https://api.github.com/repos/crate/crash/issues/events{/number}","events_url":"https://api.github.com/repos/crate/crash/events","assignees_url":"https://api.github.com/repos/crate/crash/assignees{/user}","branches_url":"https://api.github.com/repos/crate/crash/branches{/branch}","tags_url":"https://api.github.com/repos/crate/crash/tags","blobs_url":"https://api.github.com/repos/crate/crash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crate/crash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crate/crash/git/refs{/sha}","trees_url":"https://api.github.com/repos/crate/crash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crate/crash/statuses/{sha}","languages_url":"https://api.github.com/repos/crate/crash/languages","stargazers_url":"https://api.github.com/repos/crate/crash/stargazers","contributors_url":"https://api.github.com/repos/crate/crash/contributors","subscribers_url":"https://api.github.com/repos/crate/crash/subscribers","subscription_url":"https://api.github.com/repos/crate/crash/subscription","commits_url":"https://api.github.com/repos/crate/crash/commits{/sha}","git_commits_url":"https://api.github.com/repos/crate/crash/git/commits{/sha}","comments_url":"https://api.github.com/repos/crate/crash/comments{/number}","issue_comment_url":"https://api.github.com/repos/crate/crash/issues/comments{/number}","contents_url":"https://api.github.com/repos/crate/crash/contents/{+path}","compare_url":"https://api.github.com/repos/crate/crash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crate/crash/merges","archive_url":"https://api.github.com/repos/crate/crash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crate/crash/downloads","issues_url":"https://api.github.com/repos/crate/crash/issues{/number}","pulls_url":"https://api.github.com/repos/crate/crash/pulls{/number}","milestones_url":"https://api.github.com/repos/crate/crash/milestones{/number}","notifications_url":"https://api.github.com/repos/crate/crash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crate/crash/labels{/name}","releases_url":"https://api.github.com/repos/crate/crash/releases{/id}","deployments_url":"https://api.github.com/repos/crate/crash/deployments","created_at":"2014-03-13T17:52:39Z","updated_at":"2016-05-26T14:09:33Z","pushed_at":"2016-07-14T15:23:35Z","git_url":"git://github.com/crate/crash.git","ssh_url":"git@github.com:crate/crash.git","clone_url":"https://github.com/crate/crash.git","svn_url":"https://github.com/crate/crash","homepage":null,"size":399,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":4,"forks":5,"open_issues":4,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crate/crash/pulls/142"},"html":{"href":"https://github.com/crate/crash/pull/142"},"issue":{"href":"https://api.github.com/repos/crate/crash/issues/142"},"comments":{"href":"https://api.github.com/repos/crate/crash/issues/142/comments"},"review_comments":{"href":"https://api.github.com/repos/crate/crash/pulls/142/comments"},"review_comment":{"href":"https://api.github.com/repos/crate/crash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crate/crash/pulls/142/commits"},"statuses":{"href":"https://api.github.com/repos/crate/crash/statuses/79f2d9adbdfe7cc34cf8a2171404ff51021ff48e"}}}}
{"actor":{"display_login":"chaudum"}}