)]}'
{"ceilometer/agent/base.py":[{"author":{"_account_id":7052,"name":"Fabio Giannetti","email":"fgiannet@cisco.com","username":"fabgia"},"change_message_id":"825bedc3f30c8cb269a416c3ffd11b6ce283e3b3","unresolved":false,"context_lines":[{"line_number":142,"context_line":"                    # Exclude the failed resource from polling"},{"line_number":143,"context_line":"                    black_res \u003d self.resources[key].blacklist"},{"line_number":144,"context_line":"                    polling_resources \u003d list("},{"line_number":145,"context_line":"                        set(candidate_res) - set(black_res))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"                    # If no resources, skip for this pollster"},{"line_number":148,"context_line":"                    if not polling_resources:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_51644d21","line":145,"updated":"2015-02-12 01:37:35.000000000","message":"Beside being a more elegant code, can you please tell me why the one on the left did not achieve the same result?","commit_id":"224a4fca03596006a7ed74662f96aa243d9be9a6"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"9caac02dae3c2df976ca3d45b37e71ddd9a29913","unresolved":false,"context_lines":[{"line_number":142,"context_line":"                    # Exclude the failed resource from polling"},{"line_number":143,"context_line":"                    black_res \u003d self.resources[key].blacklist"},{"line_number":144,"context_line":"                    polling_resources \u003d list("},{"line_number":145,"context_line":"                        set(candidate_res) - set(black_res))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"                    # If no resources, skip for this pollster"},{"line_number":148,"context_line":"                    if not polling_resources:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_a037e7e1","line":145,"in_reply_to":"da86d52c_0a3452fa","updated":"2015-02-12 09:38:38.000000000","message":"what kind of discovery will return duplicated resources? I think that would be a high/critical bug if that happenes, and Ceilometer just silently filters them out?\n\nps: the in operator can check resource duplicate because we assume resource object has defined __equal__, for i.e. the openstack api client will return resources inherit from apiclient.base.Resouce, https://github.com/openstack/oslo-incubator/blob/03143669d2c996f7c20d2d75f6c67827d2db216a/openstack/common/apiclient/base.py#L515 but I\u0027m doubt there is __hash__ (except the resource is just string)","commit_id":"224a4fca03596006a7ed74662f96aa243d9be9a6"},{"author":{"_account_id":7052,"name":"Fabio Giannetti","email":"fgiannet@cisco.com","username":"fabgia"},"change_message_id":"f4a69317aa3361b45d53e5ec147e6393feb99796","unresolved":false,"context_lines":[{"line_number":142,"context_line":"                    # Exclude the failed resource from polling"},{"line_number":143,"context_line":"                    black_res \u003d self.resources[key].blacklist"},{"line_number":144,"context_line":"                    polling_resources \u003d list("},{"line_number":145,"context_line":"                        set(candidate_res) - set(black_res))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"                    # If no resources, skip for this pollster"},{"line_number":148,"context_line":"                    if not polling_resources:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_614dfe3d","line":145,"in_reply_to":"da86d52c_41a71a0b","updated":"2015-02-12 01:50:11.000000000","message":"got it. set returns only the unique ones. thanks","commit_id":"224a4fca03596006a7ed74662f96aa243d9be9a6"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"1b7ab0adfd8cefc9d476fb0b3b313d32934725ab","unresolved":false,"context_lines":[{"line_number":142,"context_line":"                    # Exclude the failed resource from polling"},{"line_number":143,"context_line":"                    black_res \u003d self.resources[key].blacklist"},{"line_number":144,"context_line":"                    polling_resources \u003d list("},{"line_number":145,"context_line":"                        set(candidate_res) - set(black_res))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"                    # If no resources, skip for this pollster"},{"line_number":148,"context_line":"                    if not polling_resources:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_41a71a0b","line":145,"in_reply_to":"da86d52c_51644d21","updated":"2015-02-12 01:45:07.000000000","message":"left is just remove elements in black_list\nBesides this, right remove duplicated elements via set","commit_id":"224a4fca03596006a7ed74662f96aa243d9be9a6"},{"author":{"_account_id":11235,"name":"Edwin Zhai","email":"edwin.zhai@intel.com","username":"gzhai"},"change_message_id":"c51415f3f915d699f645b0a03905e734e2960005","unresolved":false,"context_lines":[{"line_number":142,"context_line":"                    # Exclude the failed resource from polling"},{"line_number":143,"context_line":"                    black_res \u003d self.resources[key].blacklist"},{"line_number":144,"context_line":"                    polling_resources \u003d list("},{"line_number":145,"context_line":"                        set(candidate_res) - set(black_res))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"                    # If no resources, skip for this pollster"},{"line_number":148,"context_line":"                    if not polling_resources:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_0a3452fa","line":145,"in_reply_to":"da86d52c_5646fa7b","updated":"2015-02-12 08:45:04.000000000","message":"Pollster\u0027s discovery depends on other library, which probably return duplicated resources with bug.\n\nThe possibility may be small, but the question is can we afford for the consequence.","commit_id":"224a4fca03596006a7ed74662f96aa243d9be9a6"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"03ed92c6f2e7b3e3bd6910a4a5594425d7b11291","unresolved":false,"context_lines":[{"line_number":142,"context_line":"                    # Exclude the failed resource from polling"},{"line_number":143,"context_line":"                    black_res \u003d self.resources[key].blacklist"},{"line_number":144,"context_line":"                    polling_resources \u003d list("},{"line_number":145,"context_line":"                        set(candidate_res) - set(black_res))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"                    # If no resources, skip for this pollster"},{"line_number":148,"context_line":"                    if not polling_resources:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_7b74c767","line":145,"in_reply_to":"da86d52c_614dfe3d","updated":"2015-02-12 07:20:14.000000000","message":"It could be happen if the resources came from discovery duplicate with those defined in the pipeline static resource","commit_id":"224a4fca03596006a7ed74662f96aa243d9be9a6"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"cede30f19a9b9cc646fab7a8b2c2e5303f4071b8","unresolved":false,"context_lines":[{"line_number":142,"context_line":"                    # Exclude the failed resource from polling"},{"line_number":143,"context_line":"                    black_res \u003d self.resources[key].blacklist"},{"line_number":144,"context_line":"                    polling_resources \u003d list("},{"line_number":145,"context_line":"                        set(candidate_res) - set(black_res))"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"                    # If no resources, skip for this pollster"},{"line_number":148,"context_line":"                    if not polling_resources:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_5646fa7b","line":145,"in_reply_to":"da86d52c_7b74c767","updated":"2015-02-12 08:11:52.000000000","message":"@Lianhao Lu\n\nNote L139, we will use source_resources or pollster resources, pollster resources is not configurable, so let\u0027s assume there are no duplicate\n\nthe source_resource comes from subset of pipeline.resource + pipeline.discovery, so there may be duplicate only when we specify a discovery while with static resource in it, what is the scenario?\nis there any specified pollster using such configuration?\n\nThanks","commit_id":"224a4fca03596006a7ed74662f96aa243d9be9a6"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9b052ead070a795840a416aacb75553c2da9a060","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                                     pollster_resources)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"                    # Check if duplicated resources for the 1st time"},{"line_number":144,"context_line":"                    if not self.resources[key].dup_checked and len("},{"line_number":145,"context_line":"                            candidate_res) !\u003d len(set(candidate_res)):"},{"line_number":146,"context_line":"                        self.resources[key].dup_checked \u003d True"},{"line_number":147,"context_line":"                        dup_res \u003d [x for x in candidate_res"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_7c247860","line":144,"updated":"2015-02-13 14:32:19.000000000","message":"Seems like this will only report on the first set of duplicate resources encountered for a source+pollster, but then not subsequent different duplicate resources for the same source+pollster.\n\nWhy not just store the duplicated_resource list for the last cycle in the Resources object (instead of the dup_checked boolean).\n\nThen if the duplicate resources calculated for the current polling cycle is the same as the previous, don\u0027t report the LOG warning ... where if the duplicate resources calculated for the current polling cycle differs from the previous cycle, then log the warning.","commit_id":"5a865229c179657be0b292cd8238ffcea56db79b"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"e1ba218037c7e02cbf6d5ef389227452b8aefadb","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                    # Warn duplicated resources for the 1st time"},{"line_number":144,"context_line":"                    if len(candidate_res) !\u003d len(set(candidate_res)):"},{"line_number":145,"context_line":"                        dup_res \u003d set([x for x in candidate_res"},{"line_number":146,"context_line":"                                       if candidate_res.count(x) \u003e 1])"},{"line_number":147,"context_line":"                        if self.resources[key].last_dup !\u003d dup_res:"},{"line_number":148,"context_line":"                            self.resources[key].last_dup \u003d dup_res"},{"line_number":149,"context_line":"                            LOG.warning(_("}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_c8a57548","line":146,"updated":"2015-02-16 02:00:00.000000000","message":"call me paranoid, but I believe since here we want to find out both the unique and duplicated items in the list, we can do it with with some code of better performance:\n\nuniq \u003d set()\nduplicated \u003d set()\n\nfor x in candidate_res:\n    if x not in uniq :\n        uniq.add(x)\n    else:\n        duplicated.add(x)","commit_id":"4c8520d8b55499230e36a152eccbcd655e256258"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"e1ba218037c7e02cbf6d5ef389227452b8aefadb","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                            LOG.warning(_("},{"line_number":150,"context_line":"                                \u0027Found following duplicated resoures for \u0027"},{"line_number":151,"context_line":"                                \u0027%(name)s in context of %(source)s:%(list)s. \u0027"},{"line_number":152,"context_line":"                                \u0027Check if misconfigure pipeline.yaml\u0027)"},{"line_number":153,"context_line":"                                % ({\u0027name\u0027: pollster.name,"},{"line_number":154,"context_line":"                                    \u0027source\u0027: source_name,"},{"line_number":155,"context_line":"                                    \u0027list\u0027: dup_res"}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_6823a9be","line":152,"updated":"2015-02-16 02:00:00.000000000","message":"How about change it to \u0027Check pipeline configuration.\u0027\n\nbecause the use can set other file names for the pipeline configuration file","commit_id":"4c8520d8b55499230e36a152eccbcd655e256258"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"e1ba218037c7e02cbf6d5ef389227452b8aefadb","unresolved":false,"context_lines":[{"line_number":158,"context_line":"                    # Exclude the failed resource from polling"},{"line_number":159,"context_line":"                    black_res \u003d self.resources[key].blacklist"},{"line_number":160,"context_line":"                    polling_resources \u003d list("},{"line_number":161,"context_line":"                        set(candidate_res) - set(black_res))"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"                    # If no resources, skip for this pollster"},{"line_number":164,"context_line":"                    if not polling_resources:"}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_4848a587","line":161,"updated":"2015-02-16 02:00:00.000000000","message":"how about save the set(candidate_res) in Ln143 and reuse it here?","commit_id":"4c8520d8b55499230e36a152eccbcd655e256258"}]}
