{"action":"created","comment":{"url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/pulls/comments/22987062","id":22987062,"diff_hunk":"@@ -209,8 +215,64 @@ def _list_lsi_devices(self):\n             })\n         return devices\n \n+    def _is_warpdrive(self, block_device):\n+        if block_device.model == LSI_MODEL:\n+            return True\n+\n+    def _get_smartctl_attributes(self, block_device):\n+        smartout = utils.execute('smartctl', '--attributes', block_device.name)\n+        header = None\n+        it = iter(smartout.split('\\n'))\n+        for line in it:\n+            if line.strip().startswith('ID#'):\n+                header = line.strip().split()\n+                break\n+\n+        attributes = {}\n+        for line in it:\n+            line = line.strip()\n+            if not line:\n+                continue\n+            linelist = line.split(None)\n+            key = linelist[0] + '-' + linelist[1]\n+            value = dict(zip(header[2:], linelist[2:]))\n+            attributes[key] = value\n+\n+        return attributes\n+\n+    def _send_gauges(self, prefix, metrics_to_send):\n+        \"\"\"Batch-send gauges to MetricsLogger.\n+\n+        :param prefix: The prefix given to MetricLogger\n+        :param metrics: Dict in the format {'key': 'value'} where key is the\n+                        metric name and value is the metric.\n+        \"\"\"\n+        logger = metrics.getLogger(prefix)\n+        for name, gauge in metrics_to_send.iteritems():\n+            logger.gauge(name, gauge)\n+\n+    def get_disk_metrics(self):\n+        smart_data_columns = ['VALUE', 'WORST', 'THRESH', 'RAW_VALUE']\n+        block_devices = self.list_block_devices()\n+        for block_device in block_devices:\n+            if self._is_warpdrive(block_device):\n+                # TODO(JayF): Add support for Warpdrive\n+                LOG.info('Block device {0} not yet supported for collecting'\n+                         'metrics'.format(block_device.name))\n+                next","path":"onmetal_ironic_hardware_manager/__init__.py","position":61,"original_position":61,"commit_id":"39164659accc9c5b0fe3f8f71a45a1aeb5ac25fc","original_commit_id":"39164659accc9c5b0fe3f8f71a45a1aeb5ac25fc","user":{"login":"lvh","id":97816,"avatar_url":"https://avatars.githubusercontent.com/u/97816?v=3","gravatar_id":"","url":"https://api.github.com/users/lvh","html_url":"https://github.com/lvh","followers_url":"https://api.github.com/users/lvh/followers","following_url":"https://api.github.com/users/lvh/following{/other_user}","gists_url":"https://api.github.com/users/lvh/gists{/gist_id}","starred_url":"https://api.github.com/users/lvh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvh/subscriptions","organizations_url":"https://api.github.com/users/lvh/orgs","repos_url":"https://api.github.com/users/lvh/repos","events_url":"https://api.github.com/users/lvh/events{/privacy}","received_events_url":"https://api.github.com/users/lvh/received_events","type":"User","site_admin":false},"body":"This says `next`, ITYM `continue`.","created_at":"2015-01-15T02:24:27Z","updated_at":"2015-01-15T02:24:27Z","html_url":"https://github.com/rackerlabs/onmetal-ironic-hardware-manager/pull/25#discussion_r22987062","pull_request_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/pulls/comments/22987062"},"html":{"href":"https://github.com/rackerlabs/onmetal-ironic-hardware-manager/pull/25#discussion_r22987062"},"pull_request":{"href":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/pulls/25","id":27397739,"html_url":"https://github.com/rackerlabs/onmetal-ironic-hardware-manager/pull/25","diff_url":"https://github.com/rackerlabs/onmetal-ironic-hardware-manager/pull/25.diff","patch_url":"https://github.com/rackerlabs/onmetal-ironic-hardware-manager/pull/25.patch","issue_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/issues/25","number":25,"state":"open","locked":false,"title":"WIP: Collect and send SMART data to graphite","user":{"login":"jayofdoom","id":1738052,"avatar_url":"https://avatars.githubusercontent.com/u/1738052?v=3","gravatar_id":"","url":"https://api.github.com/users/jayofdoom","html_url":"https://github.com/jayofdoom","followers_url":"https://api.github.com/users/jayofdoom/followers","following_url":"https://api.github.com/users/jayofdoom/following{/other_user}","gists_url":"https://api.github.com/users/jayofdoom/gists{/gist_id}","starred_url":"https://api.github.com/users/jayofdoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayofdoom/subscriptions","organizations_url":"https://api.github.com/users/jayofdoom/orgs","repos_url":"https://api.github.com/users/jayofdoom/repos","events_url":"https://api.github.com/users/jayofdoom/events{/privacy}","received_events_url":"https://api.github.com/users/jayofdoom/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-15T00:51:25Z","updated_at":"2015-01-15T02:24:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"add681d269beadff173491826113a0a7082d212f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/pulls/25/commits","review_comments_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/pulls/25/comments","review_comment_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/pulls/comments/{number}","comments_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/issues/25/comments","statuses_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/statuses/39164659accc9c5b0fe3f8f71a45a1aeb5ac25fc","head":{"label":"rackerlabs:jay/AddSMARTStats","ref":"jay/AddSMARTStats","sha":"39164659accc9c5b0fe3f8f71a45a1aeb5ac25fc","user":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":20423296,"name":"onmetal-ironic-hardware-manager","full_name":"rackerlabs/onmetal-ironic-hardware-manager","owner":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackerlabs/onmetal-ironic-hardware-manager","description":"Hardware Manager plugin for IPA","fork":false,"url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager","forks_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/forks","keys_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/teams","hooks_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/hooks","issue_events_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/issues/events{/number}","events_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/events","assignees_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/assignees{/user}","branches_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/branches{/branch}","tags_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/tags","blobs_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/languages","stargazers_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/stargazers","contributors_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/contributors","subscribers_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/subscribers","subscription_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/subscription","commits_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/issues/comments/{number}","contents_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/contents/{+path}","compare_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/merges","archive_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/downloads","issues_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/issues{/number}","pulls_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/labels{/name}","releases_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/releases{/id}","created_at":"2014-06-02T23:31:25Z","updated_at":"2015-01-14T21:53:18Z","pushed_at":"2015-01-15T01:46:11Z","git_url":"git://github.com/rackerlabs/onmetal-ironic-hardware-manager.git","ssh_url":"git@github.com:rackerlabs/onmetal-ironic-hardware-manager.git","clone_url":"https://github.com/rackerlabs/onmetal-ironic-hardware-manager.git","svn_url":"https://github.com/rackerlabs/onmetal-ironic-hardware-manager","homepage":"","size":586,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"rackerlabs:master","ref":"master","sha":"6d53a2a72ad5ab58ad9c69e69b5ab502bc9e7244","user":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":20423296,"name":"onmetal-ironic-hardware-manager","full_name":"rackerlabs/onmetal-ironic-hardware-manager","owner":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackerlabs/onmetal-ironic-hardware-manager","description":"Hardware Manager plugin for IPA","fork":false,"url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager","forks_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/forks","keys_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/teams","hooks_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/hooks","issue_events_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/issues/events{/number}","events_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/events","assignees_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/assignees{/user}","branches_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/branches{/branch}","tags_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/tags","blobs_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/languages","stargazers_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/stargazers","contributors_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/contributors","subscribers_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/subscribers","subscription_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/subscription","commits_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/issues/comments/{number}","contents_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/contents/{+path}","compare_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/merges","archive_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/downloads","issues_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/issues{/number}","pulls_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/labels{/name}","releases_url":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/releases{/id}","created_at":"2014-06-02T23:31:25Z","updated_at":"2015-01-14T21:53:18Z","pushed_at":"2015-01-15T01:46:11Z","git_url":"git://github.com/rackerlabs/onmetal-ironic-hardware-manager.git","ssh_url":"git@github.com:rackerlabs/onmetal-ironic-hardware-manager.git","clone_url":"https://github.com/rackerlabs/onmetal-ironic-hardware-manager.git","svn_url":"https://github.com/rackerlabs/onmetal-ironic-hardware-manager","homepage":"","size":586,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/pulls/25"},"html":{"href":"https://github.com/rackerlabs/onmetal-ironic-hardware-manager/pull/25"},"issue":{"href":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/issues/25"},"comments":{"href":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/rackerlabs/onmetal-ironic-hardware-manager/statuses/39164659accc9c5b0fe3f8f71a45a1aeb5ac25fc"}}}}