{"action":"created","comment":{"url":"https://api.github.com/repos/Tendrl/monitoring-integration/pulls/comments/181550522","pull_request_review_id":112205783,"id":181550522,"diff_hunk":"@@ -192,127 +179,80 @@ def get_central_store_data(self, objects):\n                        {'message': str(ex)})\n             raise ex\n \n-    def get_cluster_details(self, objects, cluster_key):\n+    def get_cluster_details(self, objects, integration_id):\n         cluster_detail = []\n         for obj in objects[\"Cluster\"]:\n             if obj in [\"metric\", \"value\"]:\n                 continue\n             resource_detail = {}\n             resource_detail[str(obj)] = {}\n             obj_details = objects[\"Cluster\"][str(obj)]\n-            obj_key = os.path.join(cluster_key, str(obj))\n             obj_attrs = obj_details[\"attrs\"]\n+            _resource_obj = NS.tendrl.objects[str(obj)](\n+                integration_id=integration_id\n+            ).load()\n             for key, _ in obj_attrs.items():\n-                try:\n-                    attr_key = os.path.join(obj_key, key)\n-                    attr_data = etcd_utils.read(attr_key)\n-                    attr_value = self.cluster_status_mapper(\n-                        str(attr_data.value))\n-                    resource_detail[str(obj)][key] = copy.deepcopy(\n-                        attr_value\n-                    )\n-                except (KeyError, etcd.EtcdKeyNotFound) as ex:\n-                    integration_id = cluster_key.split(\"/\")[-1]\n-                    logger.log(\n-                        \"debug\",\n-                        NS.get(\"publisher_id\", None),\n-                        {'message': \"Cannot Find {0} in Cluster \"\n-                         \"{1}\".format(key, integration_id) + str(ex)\n-                         }\n-                    )\n+                attr_value = self.cluster_status_mapper(\n+                    str(getattr(_resource_obj, key))\n+                )\n+                resource_detail[str(obj)][key] = copy.deepcopy(\n+                    attr_value\n+                )\n             if not resource_detail == {}:\n                 cluster_detail.append(resource_detail)\n         return cluster_detail\n \n-    def get_brick_details(self, objects, cluster_key):\n+    def get_brick_details(self, objects, integration_id):\n         brick_detail = []\n-        host_list = utils.get_resource_keys(cluster_key, \"Bricks/all\")\n-        for host in host_list:\n-            attr_key = os.path.join(cluster_key, \"Bricks/all\", host)\n-            brick_list = utils.get_resource_keys(\"\", attr_key)\n-            for brick in brick_list:\n+        _cluster_node_ids = etcd_utils.read(\n+            \"/clusters/%s/nodes\" % integration_id\n+        )\n+        for _node_id in _cluster_node_ids.leaves:","path":"tendrl/monitoring_integration/graphite/__init__.py","position":146,"original_position":146,"commit_id":"3b69f7a319ada2da1296e168fd6b8c9a55363939","original_commit_id":"3b69f7a319ada2da1296e168fd6b8c9a55363939","user":{"login":"shtripat","id":6771252,"avatar_url":"https://avatars0.githubusercontent.com/u/6771252?v=4","gravatar_id":"","url":"https://api.github.com/users/shtripat","html_url":"https://github.com/shtripat","followers_url":"https://api.github.com/users/shtripat/followers","following_url":"https://api.github.com/users/shtripat/following{/other_user}","gists_url":"https://api.github.com/users/shtripat/gists{/gist_id}","starred_url":"https://api.github.com/users/shtripat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shtripat/subscriptions","organizations_url":"https://api.github.com/users/shtripat/orgs","repos_url":"https://api.github.com/users/shtripat/repos","events_url":"https://api.github.com/users/shtripat/events{/privacy}","received_events_url":"https://api.github.com/users/shtripat/received_events","type":"User","site_admin":false},"body":"Loading all the bricks for a cluster is not possible because the path if like `/clusters/{int-id}/Bricks/all/{host-name}/{brick-path}`. So the load_all function removes the last entry from `/` and expects rest path as collection of bricks. That's not correct in this case and so `load_all()` returns None.\r\nExplicitly I had to do this for that reason only.","created_at":"2018-04-14T12:02:40Z","updated_at":"2018-04-14T12:13:29Z","html_url":"https://github.com/Tendrl/monitoring-integration/pull/411#discussion_r181550522","pull_request_url":"https://api.github.com/repos/Tendrl/monitoring-integration/pulls/411","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Tendrl/monitoring-integration/pulls/comments/181550522"},"html":{"href":"https://github.com/Tendrl/monitoring-integration/pull/411#discussion_r181550522"},"pull_request":{"href":"https://api.github.com/repos/Tendrl/monitoring-integration/pulls/411"}},"in_reply_to_id":181549212},"pull_request":{"url":"https://api.github.com/repos/Tendrl/monitoring-integration/pulls/411","id":180892667,"html_url":"https://github.com/Tendrl/monitoring-integration/pull/411","diff_url":"https://github.com/Tendrl/monitoring-integration/pull/411.diff","patch_url":"https://github.com/Tendrl/monitoring-integration/pull/411.patch","issue_url":"https://api.github.com/repos/Tendrl/monitoring-integration/issues/411","number":411,"state":"open","locked":false,"title":"Marshal and un-marshal objects while save/read to/from etcd","user":{"login":"shtripat","id":6771252,"avatar_url":"https://avatars0.githubusercontent.com/u/6771252?v=4","gravatar_id":"","url":"https://api.github.com/users/shtripat","html_url":"https://github.com/shtripat","followers_url":"https://api.github.com/users/shtripat/followers","following_url":"https://api.github.com/users/shtripat/following{/other_user}","gists_url":"https://api.github.com/users/shtripat/gists{/gist_id}","starred_url":"https://api.github.com/users/shtripat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shtripat/subscriptions","organizations_url":"https://api.github.com/users/shtripat/orgs","repos_url":"https://api.github.com/users/shtripat/repos","events_url":"https://api.github.com/users/shtripat/events{/privacy}","received_events_url":"https://api.github.com/users/shtripat/received_events","type":"User","site_admin":false},"body":"tendrl-bug-id: Tendrl/commons#893\r\nSigned-off-by: Shubhendu <shtripat@redhat.com>","created_at":"2018-04-11T12:50:57Z","updated_at":"2018-04-14T12:13:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf47ec66bb3186d3c39739d0fb46d6dadbd47ead","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[{"name":"admins","id":2190096,"slug":"admins","description":"Tendrl org admins","privacy":"closed","url":"https://api.github.com/teams/2190096","members_url":"https://api.github.com/teams/2190096/members{/member}","repositories_url":"https://api.github.com/teams/2190096/repos","permission":"pull"}],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Tendrl/monitoring-integration/pulls/411/commits","review_comments_url":"https://api.github.com/repos/Tendrl/monitoring-integration/pulls/411/comments","review_comment_url":"https://api.github.com/repos/Tendrl/monitoring-integration/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Tendrl/monitoring-integration/issues/411/comments","statuses_url":"https://api.github.com/repos/Tendrl/monitoring-integration/statuses/3b69f7a319ada2da1296e168fd6b8c9a55363939","head":{"label":"shtripat:marshal-unmarshal-objects","ref":"marshal-unmarshal-objects","sha":"3b69f7a319ada2da1296e168fd6b8c9a55363939","user":{"login":"shtripat","id":6771252,"avatar_url":"https://avatars0.githubusercontent.com/u/6771252?v=4","gravatar_id":"","url":"https://api.github.com/users/shtripat","html_url":"https://github.com/shtripat","followers_url":"https://api.github.com/users/shtripat/followers","following_url":"https://api.github.com/users/shtripat/following{/other_user}","gists_url":"https://api.github.com/users/shtripat/gists{/gist_id}","starred_url":"https://api.github.com/users/shtripat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shtripat/subscriptions","organizations_url":"https://api.github.com/users/shtripat/orgs","repos_url":"https://api.github.com/users/shtripat/repos","events_url":"https://api.github.com/users/shtripat/events{/privacy}","received_events_url":"https://api.github.com/users/shtripat/received_events","type":"User","site_admin":false},"repo":{"id":102026808,"name":"monitoring-integration","full_name":"shtripat/monitoring-integration","owner":{"login":"shtripat","id":6771252,"avatar_url":"https://avatars0.githubusercontent.com/u/6771252?v=4","gravatar_id":"","url":"https://api.github.com/users/shtripat","html_url":"https://github.com/shtripat","followers_url":"https://api.github.com/users/shtripat/followers","following_url":"https://api.github.com/users/shtripat/following{/other_user}","gists_url":"https://api.github.com/users/shtripat/gists{/gist_id}","starred_url":"https://api.github.com/users/shtripat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shtripat/subscriptions","organizations_url":"https://api.github.com/users/shtripat/orgs","repos_url":"https://api.github.com/users/shtripat/repos","events_url":"https://api.github.com/users/shtripat/events{/privacy}","received_events_url":"https://api.github.com/users/shtripat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shtripat/monitoring-integration","description":"Component that enables integration with external monitoring services.","fork":true,"url":"https://api.github.com/repos/shtripat/monitoring-integration","forks_url":"https://api.github.com/repos/shtripat/monitoring-integration/forks","keys_url":"https://api.github.com/repos/shtripat/monitoring-integration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shtripat/monitoring-integration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shtripat/monitoring-integration/teams","hooks_url":"https://api.github.com/repos/shtripat/monitoring-integration/hooks","issue_events_url":"https://api.github.com/repos/shtripat/monitoring-integration/issues/events{/number}","events_url":"https://api.github.com/repos/shtripat/monitoring-integration/events","assignees_url":"https://api.github.com/repos/shtripat/monitoring-integration/assignees{/user}","branches_url":"https://api.github.com/repos/shtripat/monitoring-integration/branches{/branch}","tags_url":"https://api.github.com/repos/shtripat/monitoring-integration/tags","blobs_url":"https://api.github.com/repos/shtripat/monitoring-integration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shtripat/monitoring-integration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shtripat/monitoring-integration/git/refs{/sha}","trees_url":"https://api.github.com/repos/shtripat/monitoring-integration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shtripat/monitoring-integration/statuses/{sha}","languages_url":"https://api.github.com/repos/shtripat/monitoring-integration/languages","stargazers_url":"https://api.github.com/repos/shtripat/monitoring-integration/stargazers","contributors_url":"https://api.github.com/repos/shtripat/monitoring-integration/contributors","subscribers_url":"https://api.github.com/repos/shtripat/monitoring-integration/subscribers","subscription_url":"https://api.github.com/repos/shtripat/monitoring-integration/subscription","commits_url":"https://api.github.com/repos/shtripat/monitoring-integration/commits{/sha}","git_commits_url":"https://api.github.com/repos/shtripat/monitoring-integration/git/commits{/sha}","comments_url":"https://api.github.com/repos/shtripat/monitoring-integration/comments{/number}","issue_comment_url":"https://api.github.com/repos/shtripat/monitoring-integration/issues/comments{/number}","contents_url":"https://api.github.com/repos/shtripat/monitoring-integration/contents/{+path}","compare_url":"https://api.github.com/repos/shtripat/monitoring-integration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shtripat/monitoring-integration/merges","archive_url":"https://api.github.com/repos/shtripat/monitoring-integration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shtripat/monitoring-integration/downloads","issues_url":"https://api.github.com/repos/shtripat/monitoring-integration/issues{/number}","pulls_url":"https://api.github.com/repos/shtripat/monitoring-integration/pulls{/number}","milestones_url":"https://api.github.com/repos/shtripat/monitoring-integration/milestones{/number}","notifications_url":"https://api.github.com/repos/shtripat/monitoring-integration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shtripat/monitoring-integration/labels{/name}","releases_url":"https://api.github.com/repos/shtripat/monitoring-integration/releases{/id}","deployments_url":"https://api.github.com/repos/shtripat/monitoring-integration/deployments","created_at":"2017-08-31T17:30:21Z","updated_at":"2017-08-31T17:30:23Z","pushed_at":"2018-04-14T09:07:19Z","git_url":"git://github.com/shtripat/monitoring-integration.git","ssh_url":"git@github.com:shtripat/monitoring-integration.git","clone_url":"https://github.com/shtripat/monitoring-integration.git","svn_url":"https://github.com/shtripat/monitoring-integration","homepage":null,"size":3624,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Tendrl:master","ref":"master","sha":"72a0d763617300d9e31ad884f9f38de70c1cc274","user":{"login":"Tendrl","id":19151627,"avatar_url":"https://avatars0.githubusercontent.com/u/19151627?v=4","gravatar_id":"","url":"https://api.github.com/users/Tendrl","html_url":"https://github.com/Tendrl","followers_url":"https://api.github.com/users/Tendrl/followers","following_url":"https://api.github.com/users/Tendrl/following{/other_user}","gists_url":"https://api.github.com/users/Tendrl/gists{/gist_id}","starred_url":"https://api.github.com/users/Tendrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tendrl/subscriptions","organizations_url":"https://api.github.com/users/Tendrl/orgs","repos_url":"https://api.github.com/users/Tendrl/repos","events_url":"https://api.github.com/users/Tendrl/events{/privacy}","received_events_url":"https://api.github.com/users/Tendrl/received_events","type":"Organization","site_admin":false},"repo":{"id":98502817,"name":"monitoring-integration","full_name":"Tendrl/monitoring-integration","owner":{"login":"Tendrl","id":19151627,"avatar_url":"https://avatars0.githubusercontent.com/u/19151627?v=4","gravatar_id":"","url":"https://api.github.com/users/Tendrl","html_url":"https://github.com/Tendrl","followers_url":"https://api.github.com/users/Tendrl/followers","following_url":"https://api.github.com/users/Tendrl/following{/other_user}","gists_url":"https://api.github.com/users/Tendrl/gists{/gist_id}","starred_url":"https://api.github.com/users/Tendrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tendrl/subscriptions","organizations_url":"https://api.github.com/users/Tendrl/orgs","repos_url":"https://api.github.com/users/Tendrl/repos","events_url":"https://api.github.com/users/Tendrl/events{/privacy}","received_events_url":"https://api.github.com/users/Tendrl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tendrl/monitoring-integration","description":"Component that enables integration with external monitoring services.","fork":false,"url":"https://api.github.com/repos/Tendrl/monitoring-integration","forks_url":"https://api.github.com/repos/Tendrl/monitoring-integration/forks","keys_url":"https://api.github.com/repos/Tendrl/monitoring-integration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tendrl/monitoring-integration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tendrl/monitoring-integration/teams","hooks_url":"https://api.github.com/repos/Tendrl/monitoring-integration/hooks","issue_events_url":"https://api.github.com/repos/Tendrl/monitoring-integration/issues/events{/number}","events_url":"https://api.github.com/repos/Tendrl/monitoring-integration/events","assignees_url":"https://api.github.com/repos/Tendrl/monitoring-integration/assignees{/user}","branches_url":"https://api.github.com/repos/Tendrl/monitoring-integration/branches{/branch}","tags_url":"https://api.github.com/repos/Tendrl/monitoring-integration/tags","blobs_url":"https://api.github.com/repos/Tendrl/monitoring-integration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tendrl/monitoring-integration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tendrl/monitoring-integration/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tendrl/monitoring-integration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tendrl/monitoring-integration/statuses/{sha}","languages_url":"https://api.github.com/repos/Tendrl/monitoring-integration/languages","stargazers_url":"https://api.github.com/repos/Tendrl/monitoring-integration/stargazers","contributors_url":"https://api.github.com/repos/Tendrl/monitoring-integration/contributors","subscribers_url":"https://api.github.com/repos/Tendrl/monitoring-integration/subscribers","subscription_url":"https://api.github.com/repos/Tendrl/monitoring-integration/subscription","commits_url":"https://api.github.com/repos/Tendrl/monitoring-integration/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tendrl/monitoring-integration/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tendrl/monitoring-integration/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tendrl/monitoring-integration/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tendrl/monitoring-integration/contents/{+path}","compare_url":"https://api.github.com/repos/Tendrl/monitoring-integration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tendrl/monitoring-integration/merges","archive_url":"https://api.github.com/repos/Tendrl/monitoring-integration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tendrl/monitoring-integration/downloads","issues_url":"https://api.github.com/repos/Tendrl/monitoring-integration/issues{/number}","pulls_url":"https://api.github.com/repos/Tendrl/monitoring-integration/pulls{/number}","milestones_url":"https://api.github.com/repos/Tendrl/monitoring-integration/milestones{/number}","notifications_url":"https://api.github.com/repos/Tendrl/monitoring-integration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tendrl/monitoring-integration/labels{/name}","releases_url":"https://api.github.com/repos/Tendrl/monitoring-integration/releases{/id}","deployments_url":"https://api.github.com/repos/Tendrl/monitoring-integration/deployments","created_at":"2017-07-27T06:43:22Z","updated_at":"2018-04-13T08:50:35Z","pushed_at":"2018-04-14T09:07:59Z","git_url":"git://github.com/Tendrl/monitoring-integration.git","ssh_url":"git@github.com:Tendrl/monitoring-integration.git","clone_url":"https://github.com/Tendrl/monitoring-integration.git","svn_url":"https://github.com/Tendrl/monitoring-integration","homepage":null,"size":3624,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":45,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1"},"forks":13,"open_issues":45,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Tendrl/monitoring-integration/pulls/411"},"html":{"href":"https://github.com/Tendrl/monitoring-integration/pull/411"},"issue":{"href":"https://api.github.com/repos/Tendrl/monitoring-integration/issues/411"},"comments":{"href":"https://api.github.com/repos/Tendrl/monitoring-integration/issues/411/comments"},"review_comments":{"href":"https://api.github.com/repos/Tendrl/monitoring-integration/pulls/411/comments"},"review_comment":{"href":"https://api.github.com/repos/Tendrl/monitoring-integration/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Tendrl/monitoring-integration/pulls/411/commits"},"statuses":{"href":"https://api.github.com/repos/Tendrl/monitoring-integration/statuses/3b69f7a319ada2da1296e168fd6b8c9a55363939"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"shtripat"}}