)]}'
{"ceilometer/hardware/discovery.py":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"7128344d07ef1cdf878a3ba3ed16663f1c54caa1","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        resources \u003d []"},{"line_number":49,"context_line":"        for instance in instances:"},{"line_number":50,"context_line":"            try:"},{"line_number":51,"context_line":"                ip_address \u003d instance.addresses[\u0027ctlplane\u0027][0][\u0027addr\u0027]"},{"line_number":52,"context_line":"                final_address \u003d ("},{"line_number":53,"context_line":"                    cfg.CONF.hardware.url_scheme +"},{"line_number":54,"context_line":"                    cfg.CONF.hardware.readonly_user_name + \u0027:\u0027 +"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_05c4b990","line":51,"updated":"2014-09-09 15:13:33.000000000","message":"Can you add a convenience method to encapsulate the address access:\n\n  @staticmethod\n  def _address(instance, field):\n      return instance.addresses[\u0027ctlplane\u0027][0].get(field)\n\nThen you can use in the style:\n\n -                ip_address \u003d instance.addresses[\u0027ctlplane\u0027][0][\u0027addr\u0027]\n +                ip_address \u003d self._address(instance, \u0027addr\u0027)\n\nand:\n\n -                    \u0027mac_addr\u0027: (instance.addresses[\u0027ctlplane\u0027][0]\n -                                 [\u0027OS-EXT-IPS-MAC:mac_addr\u0027]),\n +                    \u0027mac_addr\u0027: self._address(\u0027OS-EXT-IPS-MAC:mac_addr\u0027)","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"},{"author":{"_account_id":7585,"name":"Ladislav Smola","email":"lsmola@redhat.com","username":"lsmola"},"change_message_id":"e762d8663f989a6ffbb54c23167520c6be755d4f","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        resources \u003d []"},{"line_number":49,"context_line":"        for instance in instances:"},{"line_number":50,"context_line":"            try:"},{"line_number":51,"context_line":"                ip_address \u003d instance.addresses[\u0027ctlplane\u0027][0][\u0027addr\u0027]"},{"line_number":52,"context_line":"                final_address \u003d ("},{"line_number":53,"context_line":"                    cfg.CONF.hardware.url_scheme +"},{"line_number":54,"context_line":"                    cfg.CONF.hardware.readonly_user_name + \u0027:\u0027 +"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_cce00799","line":51,"in_reply_to":"fa98f980_05c4b990","updated":"2014-09-10 08:49:23.000000000","message":"Done","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"}],"ceilometer/hardware/inspector/base.py":[{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"f9aeca626093c3eda43360950642c285dbb40088","unresolved":false,"context_lines":[{"line_number":25,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":26,"context_line":"class Inspector(object):"},{"line_number":27,"context_line":"    @abc.abstractmethod"},{"line_number":28,"context_line":"    def inspect_generic(self, host, identifier, cache, extra\u003d{}):"},{"line_number":29,"context_line":"        \"\"\"A generic inspect function."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        :param host: the target host"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_33e03296","line":28,"updated":"2014-09-09 10:48:21.000000000","message":"agree with Ilya here - mutables here are the great evil if it was no idea to use their opportunities as a dirty hacks here :) Please use None here and check it in the child methods like:\n\nif extra is None:\n    extra \u003d {}","commit_id":"ce44908769b53ca83190054334b6fdc0fafce75a"},{"author":{"_account_id":7585,"name":"Ladislav Smola","email":"lsmola@redhat.com","username":"lsmola"},"change_message_id":"976722e87ed27ce0c517388fa2bcbfb00ff211f1","unresolved":false,"context_lines":[{"line_number":25,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":26,"context_line":"class Inspector(object):"},{"line_number":27,"context_line":"    @abc.abstractmethod"},{"line_number":28,"context_line":"    def inspect_generic(self, host, identifier, cache, extra\u003d{}):"},{"line_number":29,"context_line":"        \"\"\"A generic inspect function."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        :param host: the target host"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_f9c4cb42","line":28,"in_reply_to":"fa98f980_33e03296","updated":"2014-09-09 11:56:44.000000000","message":"oh yeah","commit_id":"ce44908769b53ca83190054334b6fdc0fafce75a"}],"ceilometer/hardware/inspector/snmp.py":[{"author":{"_account_id":7729,"name":"Ilya Tyaptin","email":"ityaptin@mirantis.com","username":"ityaptin"},"change_message_id":"f34ed0c551573bf66818c67883bfe6f6ca768d09","unresolved":false,"context_lines":[{"line_number":354,"context_line":"                new_oids.append(metadata[0])"},{"line_number":355,"context_line":"        return new_oids"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    def inspect_generic(self, host, identifier, cache, extra\u003d{}):"},{"line_number":358,"context_line":"        # the snmp definition for the corresponding meter"},{"line_number":359,"context_line":"        meter_def \u003d self.MAPPING[identifier]"},{"line_number":360,"context_line":"        # collect oids that needs to be queried"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_f3678a4f","line":357,"updated":"2014-09-09 10:45:45.000000000","message":"If it allow, please, do not use mutable types as default args in function. \nPython’s default arguments are evaluated once when the function is defined, not each time the function is called.","commit_id":"ce44908769b53ca83190054334b6fdc0fafce75a"},{"author":{"_account_id":7585,"name":"Ladislav Smola","email":"lsmola@redhat.com","username":"lsmola"},"change_message_id":"976722e87ed27ce0c517388fa2bcbfb00ff211f1","unresolved":false,"context_lines":[{"line_number":354,"context_line":"                new_oids.append(metadata[0])"},{"line_number":355,"context_line":"        return new_oids"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    def inspect_generic(self, host, identifier, cache, extra\u003d{}):"},{"line_number":358,"context_line":"        # the snmp definition for the corresponding meter"},{"line_number":359,"context_line":"        meter_def \u003d self.MAPPING[identifier]"},{"line_number":360,"context_line":"        # collect oids that needs to be queried"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_19c42f3f","line":357,"in_reply_to":"fa98f980_f3678a4f","updated":"2014-09-09 11:56:44.000000000","message":"yeah sorry","commit_id":"ce44908769b53ca83190054334b6fdc0fafce75a"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"7128344d07ef1cdf878a3ba3ed16663f1c54caa1","unresolved":false,"context_lines":[{"line_number":383,"context_line":"                                               meter_def[\u0027metadata\u0027],"},{"line_number":384,"context_line":"                                               suffix)"},{"line_number":385,"context_line":"            if not extra:"},{"line_number":386,"context_line":"                extra \u003d {}"},{"line_number":387,"context_line":"            # call post_op for special cases"},{"line_number":388,"context_line":"            if meter_def[\u0027post_op\u0027]:"},{"line_number":389,"context_line":"                func \u003d getattr(self, meter_def[\u0027post_op\u0027], None)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_0595993f","line":386,"updated":"2014-09-09 15:13:33.000000000","message":"More pythonic as:\n\n  extra \u003d extra or {}\n\nand only needs to be done once, so check outside the for loop.","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"},{"author":{"_account_id":7585,"name":"Ladislav Smola","email":"lsmola@redhat.com","username":"lsmola"},"change_message_id":"e762d8663f989a6ffbb54c23167520c6be755d4f","unresolved":false,"context_lines":[{"line_number":383,"context_line":"                                               meter_def[\u0027metadata\u0027],"},{"line_number":384,"context_line":"                                               suffix)"},{"line_number":385,"context_line":"            if not extra:"},{"line_number":386,"context_line":"                extra \u003d {}"},{"line_number":387,"context_line":"            # call post_op for special cases"},{"line_number":388,"context_line":"            if meter_def[\u0027post_op\u0027]:"},{"line_number":389,"context_line":"                func \u003d getattr(self, meter_def[\u0027post_op\u0027], None)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_0c992f1f","line":386,"in_reply_to":"fa98f980_0595993f","updated":"2014-09-10 08:49:23.000000000","message":"Done","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"}],"ceilometer/hardware/plugin.py":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"7128344d07ef1cdf878a3ba3ed16663f1c54caa1","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    def __init__(self):"},{"line_number":43,"context_line":"        super(HardwarePollster, self).__init__()"},{"line_number":44,"context_line":"        self.inspectors \u003d {}"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def _parse_resource(self, res):"},{"line_number":47,"context_line":"        \"\"\"Parse resource from discovery."},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_254ffdbf","line":45,"updated":"2014-09-09 15:13:33.000000000","message":"@staticmethod ... can get rid of \u0027self\u0027","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"},{"author":{"_account_id":7585,"name":"Ladislav Smola","email":"lsmola@redhat.com","username":"lsmola"},"change_message_id":"e762d8663f989a6ffbb54c23167520c6be755d4f","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    def __init__(self):"},{"line_number":43,"context_line":"        super(HardwarePollster, self).__init__()"},{"line_number":44,"context_line":"        self.inspectors \u003d {}"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def _parse_resource(self, res):"},{"line_number":47,"context_line":"        \"\"\"Parse resource from discovery."},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_efba1de0","line":45,"in_reply_to":"fa98f980_254ffdbf","updated":"2014-09-10 08:49:23.000000000","message":"Done","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"7128344d07ef1cdf878a3ba3ed16663f1c54caa1","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        \"\"\""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        if isinstance(res, dict):"},{"line_number":60,"context_line":"            if not res[\u0027resource_url\u0027] or not res[\u0027resource_id\u0027]:"},{"line_number":61,"context_line":"                LOG.exception(_(\u0027Passed resource dict must contain keys \u0027"},{"line_number":62,"context_line":"                                \u0027resource_id and resource_url.\u0027))"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_a5076d80","line":60,"updated":"2014-09-09 15:13:33.000000000","message":"Surely you\u0027d need:\n\n   if \u0027resource_url\u0027 not in res or \u0027resource_id\u0027 not in res:\n\notherwise you\u0027d see a KeyError.","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"},{"author":{"_account_id":7585,"name":"Ladislav Smola","email":"lsmola@redhat.com","username":"lsmola"},"change_message_id":"e762d8663f989a6ffbb54c23167520c6be755d4f","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        \"\"\""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        if isinstance(res, dict):"},{"line_number":60,"context_line":"            if not res[\u0027resource_url\u0027] or not res[\u0027resource_id\u0027]:"},{"line_number":61,"context_line":"                LOG.exception(_(\u0027Passed resource dict must contain keys \u0027"},{"line_number":62,"context_line":"                                \u0027resource_id and resource_url.\u0027))"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_acaae316","line":60,"in_reply_to":"fa98f980_a5076d80","updated":"2014-09-10 08:49:23.000000000","message":"good catch","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"7128344d07ef1cdf878a3ba3ed16663f1c54caa1","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        if isinstance(res, dict):"},{"line_number":60,"context_line":"            if not res[\u0027resource_url\u0027] or not res[\u0027resource_id\u0027]:"},{"line_number":61,"context_line":"                LOG.exception(_(\u0027Passed resource dict must contain keys \u0027"},{"line_number":62,"context_line":"                                \u0027resource_id and resource_url.\u0027))"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"            metadata \u003d res"},{"line_number":65,"context_line":"            parsed_url \u003d netutils.urlsplit(res[\u0027resource_url\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_452081f7","line":62,"updated":"2014-09-09 15:13:33.000000000","message":"Use _LE here, see:\n\n  http://docs.openstack.org/developer/oslo.i18n/guidelines.html#log-translation","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"},{"author":{"_account_id":7585,"name":"Ladislav Smola","email":"lsmola@redhat.com","username":"lsmola"},"change_message_id":"e762d8663f989a6ffbb54c23167520c6be755d4f","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        if isinstance(res, dict):"},{"line_number":60,"context_line":"            if not res[\u0027resource_url\u0027] or not res[\u0027resource_id\u0027]:"},{"line_number":61,"context_line":"                LOG.exception(_(\u0027Passed resource dict must contain keys \u0027"},{"line_number":62,"context_line":"                                \u0027resource_id and resource_url.\u0027))"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"            metadata \u003d res"},{"line_number":65,"context_line":"            parsed_url \u003d netutils.urlsplit(res[\u0027resource_url\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_cc01e707","line":62,"in_reply_to":"fa98f980_452081f7","updated":"2014-09-10 08:49:23.000000000","message":"Hm I see that it requires oslo.i18n which is not in the requirements. Is there some other way how to import it?\n\nAlso this style of translation is used in this file twice.","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"}],"ceilometer/hardware/pollsters/util.py":[{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"d274f0478e5ad2f56ff626ca791b6c3e893993e0","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    resource_metadata \u003d make_resource_metadata(res_metadata, host_url)"},{"line_number":47,"context_line":"    resource_metadata.update(extra)"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    res_id \u003d resource_id or extra.get(\u0027resource_id\u0027) or host_url.hostname"},{"line_number":50,"context_line":"    return sample.Sample("},{"line_number":51,"context_line":"        name\u003d\u0027hardware.\u0027 + name,"},{"line_number":52,"context_line":"        type\u003dsample_type,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_a7abf587","line":49,"updated":"2014-09-09 14:13:07.000000000","message":"This is a little bit stange that resource_id is processed differently with user_id/project_id, can we unify them?","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"},{"author":{"_account_id":7585,"name":"Ladislav Smola","email":"lsmola@redhat.com","username":"lsmola"},"change_message_id":"e762d8663f989a6ffbb54c23167520c6be755d4f","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    resource_metadata \u003d make_resource_metadata(res_metadata, host_url)"},{"line_number":47,"context_line":"    resource_metadata.update(extra)"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    res_id \u003d resource_id or extra.get(\u0027resource_id\u0027) or host_url.hostname"},{"line_number":50,"context_line":"    return sample.Sample("},{"line_number":51,"context_line":"        name\u003d\u0027hardware.\u0027 + name,"},{"line_number":52,"context_line":"        type\u003dsample_type,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_6f41cd38","line":49,"in_reply_to":"fa98f980_a7abf587","updated":"2014-09-10 08:49:23.000000000","message":"Done","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"}],"ceilometer/tests/hardware/pollsters/base.py":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"7128344d07ef1cdf878a3ba3ed16663f1c54caa1","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        \u0027disk.size.used\u0027: (90, disk_metadata, {}),"},{"line_number":43,"context_line":"    }"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def inspect_generic(self, host, identifier, cache, extra\u003dNone):"},{"line_number":46,"context_line":"        yield self.DATA[identifier]"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_65e02597","line":45,"updated":"2014-09-09 15:13:33.000000000","message":"Would it be clearer to just use \u0027metadata\u0027 instead of \u0027extra\u0027?","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"},{"author":{"_account_id":7585,"name":"Ladislav Smola","email":"lsmola@redhat.com","username":"lsmola"},"change_message_id":"e762d8663f989a6ffbb54c23167520c6be755d4f","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        \u0027disk.size.used\u0027: (90, disk_metadata, {}),"},{"line_number":43,"context_line":"    }"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def inspect_generic(self, host, identifier, cache, extra\u003dNone):"},{"line_number":46,"context_line":"        yield self.DATA[identifier]"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_cf8b9966","line":45,"in_reply_to":"fa98f980_65e02597","updated":"2014-09-10 08:49:23.000000000","message":"changed to extra_metadata, as metadata are already used inside this method","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"}],"ceilometer/tests/hardware/pollsters/test_util.py":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"7128344d07ef1cdf878a3ba3ed16663f1c54caa1","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        self.assertEqual({\u0027resource_url\u0027: \u0027snmp://127.0.0.1:161\u0027,"},{"line_number":58,"context_line":"                          \u0027project_id\u0027: \u0027project\u0027,"},{"line_number":59,"context_line":"                          \u0027resource_id\u0027:"},{"line_number":60,"context_line":"                          \u0027resource\u0027}, s.resource_metadata)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_25845db0","line":60,"updated":"2014-09-09 15:13:33.000000000","message":"This alignment looks kinda odd, why not:\n\n  self.assertEqual({\u0027resource_url\u0027: \u0027snmp://127.0.0.1:161\u0027,\n                    \u0027project_id\u0027: \u0027project\u0027\n                    \u0027resource_id\u0027: \u0027resource\u0027},\n                    s.resource_metadata)","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"},{"author":{"_account_id":7585,"name":"Ladislav Smola","email":"lsmola@redhat.com","username":"lsmola"},"change_message_id":"e762d8663f989a6ffbb54c23167520c6be755d4f","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        self.assertEqual({\u0027resource_url\u0027: \u0027snmp://127.0.0.1:161\u0027,"},{"line_number":58,"context_line":"                          \u0027project_id\u0027: \u0027project\u0027,"},{"line_number":59,"context_line":"                          \u0027resource_id\u0027:"},{"line_number":60,"context_line":"                          \u0027resource\u0027}, s.resource_metadata)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_8fe271ff","line":60,"in_reply_to":"fa98f980_25845db0","updated":"2014-09-10 08:49:23.000000000","message":"Done","commit_id":"b76393634d0f730bc50355fadab7e7d3080c1f9d"}]}
