)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8852b2fea80b7178bee9a9856ab34b687843d657","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add send-data-to-ceilometer support for pxe_ipminative driver"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch will implement pxe_ipminative driver *get_sensors_data* method to get"},{"line_number":10,"context_line":"sensor data by pyghmi get_sensor_data() method call."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Spec: https://review.openstack.org/102435"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"1abeadc6_d8397fa5","line":9,"updated":"2014-08-20 20:02:17.000000000","message":"also fake_ipminative?","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"ca6d33447637a74836a9053e70dd9c75be2a1a8e","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add send-data-to-ceilometer support for pxe_ipminative driver"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch will implement pxe_ipminative driver *get_sensors_data* method to get"},{"line_number":10,"context_line":"sensor data by pyghmi get_sensor_data() method call."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Spec: https://review.openstack.org/102435"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"1abeadc6_d7014507","line":9,"in_reply_to":"1abeadc6_d8397fa5","updated":"2014-08-21 02:31:48.000000000","message":"Good catch, I will add to fake_ipminative.","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":10035,"name":"greghaynes","email":"greg@greghaynes.net","username":"greghaynes"},"change_message_id":"156dc4dc44723ac8a7324fe566bc4555afc53810","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This patch will implement pxe_ipminative driver *get_sensors_data* method to get"},{"line_number":10,"context_line":"sensor data by pyghmi get_sensor_data() method call."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Spec: https://review.openstack.org/102435"},{"line_number":13,"context_line":"Related patch: https://review.openstack.org/#/c/72538/"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I2368e78e39970b7a3cffe3d8cb2dd3fce5056635"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"1abeadc6_3eeb3bb1","line":12,"updated":"2014-08-20 21:26:52.000000000","message":"Please use change-id\u0027s instead of gerrit url\u0027s.","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"ca6d33447637a74836a9053e70dd9c75be2a1a8e","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This patch will implement pxe_ipminative driver *get_sensors_data* method to get"},{"line_number":10,"context_line":"sensor data by pyghmi get_sensor_data() method call."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Spec: https://review.openstack.org/102435"},{"line_number":13,"context_line":"Related patch: https://review.openstack.org/#/c/72538/"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I2368e78e39970b7a3cffe3d8cb2dd3fce5056635"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"1abeadc6_770eb13c","line":12,"in_reply_to":"1abeadc6_3eeb3bb1","updated":"2014-08-21 02:31:48.000000000","message":"The spec is approved, I will paste the git url here:\n\nhttps://github.com/openstack/ironic-specs/blob/master/specs/juno/send-data-to-ceilometer.rst","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8852b2fea80b7178bee9a9856ab34b687843d657","unresolved":false,"context_lines":[{"line_number":13,"context_line":"Related patch: https://review.openstack.org/#/c/72538/"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I2368e78e39970b7a3cffe3d8cb2dd3fce5056635"},{"line_number":16,"context_line":"Implements: blueprint send-data-to-ceilometer"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"1abeadc6_d12ddf96","line":16,"updated":"2014-08-20 20:02:17.000000000","message":"I clicked on this link, and didn\u0027t get the blueprint. Would you check this?","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"facaa736f7ea450ac7b79fd4f11610e0886a302b","unresolved":false,"context_lines":[{"line_number":13,"context_line":"Related patch: https://review.openstack.org/#/c/72538/"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I2368e78e39970b7a3cffe3d8cb2dd3fce5056635"},{"line_number":16,"context_line":"Implements: blueprint send-data-to-ceilometer"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"1abeadc6_0899121f","line":16,"in_reply_to":"1abeadc6_cc0d1840","updated":"2014-08-27 07:36:56.000000000","message":"I think it is not the part of the spec, the spec is focusing on ipmitool driver, but this ipminative patch is related with the spec, so I remove it from next patch, and we dont need a bug I think.","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"ca6d33447637a74836a9053e70dd9c75be2a1a8e","unresolved":false,"context_lines":[{"line_number":13,"context_line":"Related patch: https://review.openstack.org/#/c/72538/"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I2368e78e39970b7a3cffe3d8cb2dd3fce5056635"},{"line_number":16,"context_line":"Implements: blueprint send-data-to-ceilometer"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"1abeadc6_d72a258f","line":16,"in_reply_to":"1abeadc6_d12ddf96","updated":"2014-08-21 02:31:48.000000000","message":"Yes, that because the blueprint is marked as implemented status, so it can not be checked out, I will remove this line.","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"3a0916de01c597a38a5e505683ba0acb0d3d7a85","unresolved":false,"context_lines":[{"line_number":13,"context_line":"Related patch: https://review.openstack.org/#/c/72538/"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I2368e78e39970b7a3cffe3d8cb2dd3fce5056635"},{"line_number":16,"context_line":"Implements: blueprint send-data-to-ceilometer"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"1abeadc6_cc0d1840","line":16,"in_reply_to":"1abeadc6_d72a258f","updated":"2014-08-21 21:35:56.000000000","message":"Is it part of the spec? If so, can\u0027t/shouldn\u0027t the spec status be changed?\nIf it isn\u0027t part of the spec, then maybe it needs a bug?","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"}],"ironic/drivers/modules/ipminative.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"bd68c2ef92b5971f0516a9ad6445d55d946d9995","unresolved":false,"context_lines":[{"line_number":221,"context_line":""},{"line_number":222,"context_line":"def _normalize_sensors_data(node, data):"},{"line_number":223,"context_line":"    sensors_data \u003d {}"},{"line_number":224,"context_line":"    if data:"},{"line_number":225,"context_line":"        for reading in data:"},{"line_number":226,"context_line":"            if not reading.value:"},{"line_number":227,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_67372aff","line":224,"updated":"2014-08-07 09:07:28.000000000","message":"to reduce indent, you\u0027d better use:\n\n if not data:\n   return {}","commit_id":"fe7c588c57d6173f63ff0cfa09d95915f753a4f5"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"bd68c2ef92b5971f0516a9ad6445d55d946d9995","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                continue"},{"line_number":228,"context_line":"            if reading.type not in sensors_data:"},{"line_number":229,"context_line":"                sensors_data[reading.type] \u003d {}"},{"line_number":230,"context_line":"                sensors_data[reading.type][reading.name] \u003d {"},{"line_number":231,"context_line":"                  \u0027Sensor Reading\u0027: reading.value,"},{"line_number":232,"context_line":"                  \u0027Sensor ID\u0027: reading.name,"},{"line_number":233,"context_line":"                  \u0027States\u0027: reading.states,"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_a707821d","line":230,"updated":"2014-08-07 09:07:28.000000000","message":"Seems like this line should not be inside `if` block (one of the reasons I usually prefer setdefault)","commit_id":"fe7c588c57d6173f63ff0cfa09d95915f753a4f5"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"bd68c2ef92b5971f0516a9ad6445d55d946d9995","unresolved":false,"context_lines":[{"line_number":412,"context_line":""},{"line_number":413,"context_line":"        :param task: a TaskManager instance."},{"line_number":414,"context_line":"        :raises: FailedToGetSensorData when getting the sensor data fails."},{"line_number":415,"context_line":"        :raises: FailedToParseSensorData when parsing sensor data fails."},{"line_number":416,"context_line":"        :raises: InvalidParameterValue if required ipmi parameters are missing"},{"line_number":417,"context_line":"        :returns: returns a dict of sensor data group by sensor type."},{"line_number":418,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_e7017a08","line":415,"updated":"2014-08-07 09:07:28.000000000","message":"Is it also WIP? because now it does not raise FailedToParseSensorData","commit_id":"fe7c588c57d6173f63ff0cfa09d95915f753a4f5"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"d0513a7f3999dc08793ea8bec2b59ff26a5d190f","unresolved":false,"context_lines":[{"line_number":223,"context_line":"    \"\"\"Get sensors data."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    :param driver_info: node\u0027s driver info"},{"line_number":226,"context_line":"    :raises: InvalidParameterValue if required ipmi parameters are missing"},{"line_number":227,"context_line":"    :returns: returns a dict of sensor data group by sensor type."},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_65939b4f","line":226,"updated":"2014-08-19 17:26:54.000000000","message":"looks like we can raise FailedToGetSensorData here not InvalidParameterValue","commit_id":"75e1ca6b35d303024c6a6d9e6029a7133a41ca76"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"d0513a7f3999dc08793ea8bec2b59ff26a5d190f","unresolved":false,"context_lines":[{"line_number":225,"context_line":"    :param driver_info: node\u0027s driver info"},{"line_number":226,"context_line":"    :raises: InvalidParameterValue if required ipmi parameters are missing"},{"line_number":227,"context_line":"    :returns: returns a dict of sensor data group by sensor type."},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    \"\"\""},{"line_number":230,"context_line":"    try:"},{"line_number":231,"context_line":"        ipmicmd \u003d ipmi_command.Command(bmc\u003ddriver_info[\u0027address\u0027],"}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_658c7b36","line":228,"updated":"2014-08-19 17:26:54.000000000","message":"Nit: blank line not needed here.","commit_id":"75e1ca6b35d303024c6a6d9e6029a7133a41ca76"},{"author":{"_account_id":10035,"name":"greghaynes","email":"greg@greghaynes.net","username":"greghaynes"},"change_message_id":"156dc4dc44723ac8a7324fe566bc4555afc53810","unresolved":false,"context_lines":[{"line_number":223,"context_line":"    \"\"\"Get sensors data."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    :param driver_info: node\u0027s driver info"},{"line_number":226,"context_line":"    :returns: returns a dict of sensor data group by sensor type."},{"line_number":227,"context_line":"    \"\"\""},{"line_number":228,"context_line":"    try:"},{"line_number":229,"context_line":"        ipmicmd \u003d ipmi_command.Command(bmc\u003ddriver_info[\u0027address\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_a9b47735","line":226,"updated":"2014-08-20 21:26:52.000000000","message":"Were also missing a raises docstring for FailedToGetSensorData","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8852b2fea80b7178bee9a9856ab34b687843d657","unresolved":false,"context_lines":[{"line_number":223,"context_line":"    \"\"\"Get sensors data."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    :param driver_info: node\u0027s driver info"},{"line_number":226,"context_line":"    :returns: returns a dict of sensor data group by sensor type."},{"line_number":227,"context_line":"    \"\"\""},{"line_number":228,"context_line":"    try:"},{"line_number":229,"context_line":"        ipmicmd \u003d ipmi_command.Command(bmc\u003ddriver_info[\u0027address\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_31437343","line":226,"updated":"2014-08-20 20:02:17.000000000","message":"nit, if I understand this, \u0027data group by sensor type\u0027 -\u003e \u0027data, grouped by sensor type\u0027. So it is a dictionary keyed by sensor type, with value being a dictionary of sensor data, right?\n\nIs there a wiki or documentation that provides more information or an example of this data? (I wanted to make sure I understood what the dict contains.)\n\nI don\u0027t know what the possible sensor types are, but from the code, I see that sensor data is: \u0027Sensor Reading\u0027, \u0027Sensor ID\u0027, \u0027States\u0027, \u0027Units\u0027, \u0027Health\u0027. Is it worth mentioning this in the docstring? (or maybe in the get_sensors_data() docstring? Or maybe not at all.)","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"3a0916de01c597a38a5e505683ba0acb0d3d7a85","unresolved":false,"context_lines":[{"line_number":223,"context_line":"    \"\"\"Get sensors data."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    :param driver_info: node\u0027s driver info"},{"line_number":226,"context_line":"    :returns: returns a dict of sensor data group by sensor type."},{"line_number":227,"context_line":"    \"\"\""},{"line_number":228,"context_line":"    try:"},{"line_number":229,"context_line":"        ipmicmd \u003d ipmi_command.Command(bmc\u003ddriver_info[\u0027address\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_27b94715","line":226,"in_reply_to":"1abeadc6_176bbdf2","updated":"2014-08-21 21:35:56.000000000","message":"Thx for explaining. I just think that \u0027a dict of sensor data group by sensor type\u0027 doesn\u0027t really explain much. Personally, I\u0027d like more detail. But that might just be a nit on my part. (Not sure how much we should expect people to refer to the spec, vs what to put in the docstrings.)","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"ca6d33447637a74836a9053e70dd9c75be2a1a8e","unresolved":false,"context_lines":[{"line_number":223,"context_line":"    \"\"\"Get sensors data."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    :param driver_info: node\u0027s driver info"},{"line_number":226,"context_line":"    :returns: returns a dict of sensor data group by sensor type."},{"line_number":227,"context_line":"    \"\"\""},{"line_number":228,"context_line":"    try:"},{"line_number":229,"context_line":"        ipmicmd \u003d ipmi_command.Command(bmc\u003ddriver_info[\u0027address\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_176bbdf2","line":226,"in_reply_to":"1abeadc6_31437343","updated":"2014-08-21 02:31:48.000000000","message":"Ruby,\n\nYes the data model is confirmed by Ceilometer team, and our ipmitool driver implemented this already, we just implement ipminative driver here to support same behavior for Ceilometer to send the ipmi sensor data.\n\nThe \u0027Sensor Reading\u0027 is the main value for Ceilometer to monitor sensor current value, we can get details from the spec [1] to get more understanding.\n\nAnd paste here the spec[1] and sample data, you can take them as reference.\n\n[1] https://github.com/openstack/ironic-specs/blob/master/specs/juno/send-data-to-ceilometer.rst\n\n[2] http://paste.openstack.org/show/85053/\n\n\nThanks for your comments.","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"ca6d33447637a74836a9053e70dd9c75be2a1a8e","unresolved":false,"context_lines":[{"line_number":223,"context_line":"    \"\"\"Get sensors data."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    :param driver_info: node\u0027s driver info"},{"line_number":226,"context_line":"    :returns: returns a dict of sensor data group by sensor type."},{"line_number":227,"context_line":"    \"\"\""},{"line_number":228,"context_line":"    try:"},{"line_number":229,"context_line":"        ipmicmd \u003d ipmi_command.Command(bmc\u003ddriver_info[\u0027address\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_777951c7","line":226,"in_reply_to":"1abeadc6_a9b47735","updated":"2014-08-21 02:31:48.000000000","message":"Ok, I will add, thank you.","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8852b2fea80b7178bee9a9856ab34b687843d657","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            userid\u003ddriver_info[\u0027username\u0027],"},{"line_number":231,"context_line":"            password\u003ddriver_info[\u0027password\u0027])"},{"line_number":232,"context_line":"        ret \u003d ipmicmd.get_sensor_data()"},{"line_number":233,"context_line":"    except pyghmi_exception.IpmiException as e:"},{"line_number":234,"context_line":"        LOG.error(_LE(\"IPMI get sensor data failed for node %(node_id)s \""},{"line_number":235,"context_line":"                  \"with the following error: %(error)s\"),"},{"line_number":236,"context_line":"              {\u0027node_id\u0027: driver_info[\u0027uuid\u0027], \u0027error\u0027: e})"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_11ecb78e","line":233,"updated":"2014-08-20 20:02:17.000000000","message":"looks like get_sensor_data() can raise Exception :-(\n\nhttps://github.com/stackforge/pyghmi/blob/master/pyghmi/ipmi/command.py#L325","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"ca6d33447637a74836a9053e70dd9c75be2a1a8e","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            userid\u003ddriver_info[\u0027username\u0027],"},{"line_number":231,"context_line":"            password\u003ddriver_info[\u0027password\u0027])"},{"line_number":232,"context_line":"        ret \u003d ipmicmd.get_sensor_data()"},{"line_number":233,"context_line":"    except pyghmi_exception.IpmiException as e:"},{"line_number":234,"context_line":"        LOG.error(_LE(\"IPMI get sensor data failed for node %(node_id)s \""},{"line_number":235,"context_line":"                  \"with the following error: %(error)s\"),"},{"line_number":236,"context_line":"              {\u0027node_id\u0027: driver_info[\u0027uuid\u0027], \u0027error\u0027: e})"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_b77f69aa","line":233,"in_reply_to":"1abeadc6_11ecb78e","updated":"2014-08-21 02:31:48.000000000","message":"Great catch, let us capture Exception here.","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8852b2fea80b7178bee9a9856ab34b687843d657","unresolved":false,"context_lines":[{"line_number":243,"context_line":"    sensors_data \u003d {}"},{"line_number":244,"context_line":"    for reading in ret:"},{"line_number":245,"context_line":"        # ignore the sensor data which has no sensor reading value"},{"line_number":246,"context_line":"        if not reading.value:"},{"line_number":247,"context_line":"            continue"},{"line_number":248,"context_line":"        sensors_data.setdefault(reading.type,"},{"line_number":249,"context_line":"            {})[reading.name] \u003d {"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_55b1ba45","line":246,"updated":"2014-08-20 20:02:17.000000000","message":"I notice that there is a reading.unavailable. Do you know what the diff is between .unavailable\u003d\u003d1 vs not .value?","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"ca6d33447637a74836a9053e70dd9c75be2a1a8e","unresolved":false,"context_lines":[{"line_number":243,"context_line":"    sensors_data \u003d {}"},{"line_number":244,"context_line":"    for reading in ret:"},{"line_number":245,"context_line":"        # ignore the sensor data which has no sensor reading value"},{"line_number":246,"context_line":"        if not reading.value:"},{"line_number":247,"context_line":"            continue"},{"line_number":248,"context_line":"        sensors_data.setdefault(reading.type,"},{"line_number":249,"context_line":"            {})[reading.name] \u003d {"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_f733a111","line":246,"in_reply_to":"1abeadc6_55b1ba45","updated":"2014-08-21 02:31:48.000000000","message":"The reason we check reading.value, because it is confirmed with Ceilometer team, the reading.value is the sensor current value, so that is required for Ceiloemter, if it is None, no need to send to Ceilometer.\n\nAnd we can find the details from our spec as below [1].\n\n[1] https://github.com/openstack/ironic-specs/blob/master/specs/juno/send-data-to-ceilometer.rst","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8852b2fea80b7178bee9a9856ab34b687843d657","unresolved":false,"context_lines":[{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        :param task: a TaskManager instance."},{"line_number":437,"context_line":"        :raises: FailedToGetSensorData when getting the sensor data fails."},{"line_number":438,"context_line":"        :raises: InvalidParameterValue if required ipmi parameters are missing"},{"line_number":439,"context_line":"        :returns: returns a dict of sensor data group by sensor type."},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_5598dabf","line":438,"updated":"2014-08-20 20:02:17.000000000","message":"When you rebase, you\u0027ll see that this has been changed to MissingParameterValue.","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"ca6d33447637a74836a9053e70dd9c75be2a1a8e","unresolved":false,"context_lines":[{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        :param task: a TaskManager instance."},{"line_number":437,"context_line":"        :raises: FailedToGetSensorData when getting the sensor data fails."},{"line_number":438,"context_line":"        :raises: InvalidParameterValue if required ipmi parameters are missing"},{"line_number":439,"context_line":"        :returns: returns a dict of sensor data group by sensor type."},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_373a79e7","line":438,"in_reply_to":"1abeadc6_5598dabf","updated":"2014-08-21 02:31:48.000000000","message":"+1, let me change the doc string, thanks Ruby.","commit_id":"2299f676043209e6c2211e558ed31594cf80d7a1"}],"ironic/tests/drivers/test_ipminative.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"6af68988c82e23a621988cadc27335e0d7e6c67e","unresolved":false,"context_lines":[{"line_number":132,"context_line":"    @mock.patch(\u0027pyghmi.ipmi.command.Command\u0027)"},{"line_number":133,"context_line":"    @mock.patch(\u0027pyghmi.ipmi.sdr.SensorReading\u0027)"},{"line_number":134,"context_line":"    @mock.patch(\u0027pyghmi.ipmi.sdr.SensorReading\u0027)"},{"line_number":135,"context_line":"    @mock.patch(\u0027pyghmi.ipmi.sdr.SensorReading\u0027)"},{"line_number":136,"context_line":"    def test__get_sensors_data(self, reading_1_mock, reading_2_mock,"},{"line_number":137,"context_line":"            reading_3_mock, ipmi_mock):"},{"line_number":138,"context_line":"        reading_dict_1 \u003d {"}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_ae087892","line":135,"updated":"2014-08-25 14:52:38.000000000","message":"these 3 mocks are not needed - see below","commit_id":"86b871561ea934eab195217c33a00b50883b7e10"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"f631ba8c6c9385e30bb49969dcc88adf51a74fa6","unresolved":false,"context_lines":[{"line_number":132,"context_line":"    @mock.patch(\u0027pyghmi.ipmi.command.Command\u0027)"},{"line_number":133,"context_line":"    @mock.patch(\u0027pyghmi.ipmi.sdr.SensorReading\u0027)"},{"line_number":134,"context_line":"    @mock.patch(\u0027pyghmi.ipmi.sdr.SensorReading\u0027)"},{"line_number":135,"context_line":"    @mock.patch(\u0027pyghmi.ipmi.sdr.SensorReading\u0027)"},{"line_number":136,"context_line":"    def test__get_sensors_data(self, reading_1_mock, reading_2_mock,"},{"line_number":137,"context_line":"            reading_3_mock, ipmi_mock):"},{"line_number":138,"context_line":"        reading_dict_1 \u003d {"}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_e89a44c4","line":135,"in_reply_to":"1abeadc6_ae087892","updated":"2014-08-27 07:15:50.000000000","message":"OK","commit_id":"86b871561ea934eab195217c33a00b50883b7e10"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"6af68988c82e23a621988cadc27335e0d7e6c67e","unresolved":false,"context_lines":[{"line_number":152,"context_line":"            }"},{"line_number":153,"context_line":"        reading_1 \u003d reading_1_mock(reading_dict_1, \u0027fake_units\u0027)"},{"line_number":154,"context_line":"        reading_2 \u003d reading_2_mock(reading_dict_2, \u0027fake_units\u0027)"},{"line_number":155,"context_line":"        reading_3 \u003d reading_3_mock(reading_dict_3, \u0027fake_units\u0027)"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        reading_1.value \u003d \u0027fake_value1\u0027"},{"line_number":158,"context_line":"        reading_1.type \u003d \u0027fake_type_A\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_0e940c43","line":155,"updated":"2014-08-25 14:52:38.000000000","message":"all these complex mocking can be replaced by equivalent:\n\n reading1 \u003d mock.Mock()\n reading2 \u003d mock.Mock()\n reading3 \u003d mock.Mock()","commit_id":"86b871561ea934eab195217c33a00b50883b7e10"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"f631ba8c6c9385e30bb49969dcc88adf51a74fa6","unresolved":false,"context_lines":[{"line_number":152,"context_line":"            }"},{"line_number":153,"context_line":"        reading_1 \u003d reading_1_mock(reading_dict_1, \u0027fake_units\u0027)"},{"line_number":154,"context_line":"        reading_2 \u003d reading_2_mock(reading_dict_2, \u0027fake_units\u0027)"},{"line_number":155,"context_line":"        reading_3 \u003d reading_3_mock(reading_dict_3, \u0027fake_units\u0027)"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        reading_1.value \u003d \u0027fake_value1\u0027"},{"line_number":158,"context_line":"        reading_1.type \u003d \u0027fake_type_A\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_68ae34e9","line":155,"in_reply_to":"1abeadc6_0e940c43","updated":"2014-08-27 07:15:50.000000000","message":"Yes, like this good idea to use mock object directly.","commit_id":"86b871561ea934eab195217c33a00b50883b7e10"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"6af68988c82e23a621988cadc27335e0d7e6c67e","unresolved":false,"context_lines":[{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        reading_1 \u003d reading_1_mock(reading_dict_1, \u0027fake_units\u0027)"},{"line_number":233,"context_line":"        reading_2 \u003d reading_2_mock(reading_dict_2, \u0027fake_units\u0027)"},{"line_number":234,"context_line":"        reading_3 \u003d reading_3_mock(reading_dict_3, \u0027fake_units\u0027)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"        reading_1.value \u003d \u0027fake_value1\u0027"},{"line_number":237,"context_line":"        reading_1.type \u003d \u0027fake_type_A\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_8e2adce5","line":234,"updated":"2014-08-25 14:52:38.000000000","message":"ditto","commit_id":"86b871561ea934eab195217c33a00b50883b7e10"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"6af68988c82e23a621988cadc27335e0d7e6c67e","unresolved":false,"context_lines":[{"line_number":466,"context_line":"        with task_manager.acquire(self.context,"},{"line_number":467,"context_line":"                                  self.node.uuid) as task:"},{"line_number":468,"context_line":"            self.driver.management.get_sensors_data(task)"},{"line_number":469,"context_line":"        ipmicmd.get_sensor_data.assert_called_once()"}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_6e4580b2","line":469,"updated":"2014-08-25 14:52:38.000000000","message":"s/assert_called_once/assert_called_once_with/","commit_id":"86b871561ea934eab195217c33a00b50883b7e10"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"19e7e70e558c3e297bb7bca7b121d7b1cb715a1d","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    @mock.patch(\u0027pyghmi.ipmi.command.Command\u0027)"},{"line_number":133,"context_line":"    def test__get_sensors_data(self, ipmi_mock):"},{"line_number":134,"context_line":"        reading_1 \u003d mock.Mock()"},{"line_number":135,"context_line":"        reading_2 \u003d mock.Mock()"},{"line_number":136,"context_line":"        reading_3 \u003d mock.Mock()"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"1abeadc6_9221c9fe","line":134,"updated":"2014-08-27 10:18:06.000000000","message":"Mock not needed for this fake objects.\nclass Reading:\n    pass\n\nreading_1 \u003d Reading()","commit_id":"0f6befb44b689aa3a6f2f70660a2e8d71192cc20"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"098589fd07b80ec49dd20d64a792a5a60ff896ed","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    @mock.patch(\u0027pyghmi.ipmi.command.Command\u0027)"},{"line_number":133,"context_line":"    def test__get_sensors_data(self, ipmi_mock):"},{"line_number":134,"context_line":"        reading_1 \u003d mock.Mock()"},{"line_number":135,"context_line":"        reading_2 \u003d mock.Mock()"},{"line_number":136,"context_line":"        reading_3 \u003d mock.Mock()"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"1abeadc6_d426ccb9","line":134,"in_reply_to":"1abeadc6_9221c9fe","updated":"2014-08-27 11:14:27.000000000","message":"Arguable. 2 additional lines :)","commit_id":"0f6befb44b689aa3a6f2f70660a2e8d71192cc20"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"3687a704a56dbfc6df5a7f21aa3673b75db17f11","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    @mock.patch(\u0027pyghmi.ipmi.command.Command\u0027)"},{"line_number":133,"context_line":"    def test__get_sensors_data(self, ipmi_mock):"},{"line_number":134,"context_line":"        reading_1 \u003d mock.Mock()"},{"line_number":135,"context_line":"        reading_2 \u003d mock.Mock()"},{"line_number":136,"context_line":"        reading_3 \u003d mock.Mock()"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"1abeadc6_f5d6464e","line":134,"in_reply_to":"1abeadc6_9221c9fe","updated":"2014-08-28 02:27:21.000000000","message":"OK, we can define new class to simulate the pyghmi output data.","commit_id":"0f6befb44b689aa3a6f2f70660a2e8d71192cc20"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"0506f63ef9f0fccbac5fd1532a0283d4e38fa211","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    @mock.patch(\u0027pyghmi.ipmi.command.Command\u0027)"},{"line_number":133,"context_line":"    def test__get_sensors_data(self, ipmi_mock):"},{"line_number":134,"context_line":"        reading_1 \u003d mock.Mock()"},{"line_number":135,"context_line":"        reading_2 \u003d mock.Mock()"},{"line_number":136,"context_line":"        reading_3 \u003d mock.Mock()"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"1abeadc6_7707ba1d","line":134,"in_reply_to":"1abeadc6_d426ccb9","updated":"2014-08-27 12:07:13.000000000","message":"1) Additional unnecessary __init__() code\n2) Bigger memory usage (more than 3 times when I create a lot of objects).","commit_id":"0f6befb44b689aa3a6f2f70660a2e8d71192cc20"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"19e7e70e558c3e297bb7bca7b121d7b1cb715a1d","unresolved":false,"context_lines":[{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    @mock.patch(\u0027pyghmi.ipmi.command.Command\u0027)"},{"line_number":192,"context_line":"    def test__get_sensors_data_missing_values(self, ipmi_mock):"},{"line_number":193,"context_line":"        reading_1 \u003d mock.Mock()"},{"line_number":194,"context_line":"        reading_2 \u003d mock.Mock()"},{"line_number":195,"context_line":"        reading_3 \u003d mock.Mock()"},{"line_number":196,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"1abeadc6_d21b41c8","line":193,"updated":"2014-08-27 10:18:06.000000000","message":"ditto","commit_id":"0f6befb44b689aa3a6f2f70660a2e8d71192cc20"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"0d8d1d4af101f86dd6ba4fb74f1f0f0a125f6d87","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        reading_3.name \u003d \u0027fake_name_3\u0027"},{"line_number":157,"context_line":"        reading_3.states \u003d []"},{"line_number":158,"context_line":"        reading_3.units \u003d \u0027fake_units\u0027"},{"line_number":159,"context_line":"        reading_3.health \u003d 0"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"        readings \u003d [reading_1, reading_2, reading_3]"},{"line_number":162,"context_line":"        ipmicmd \u003d ipmi_mock.return_value"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa98f980_d5e7e7e2","line":159,"updated":"2014-09-01 13:57:39.000000000","message":"It\u0027s mostly a nit, but I think we could create a helper class to create those objects and avoid code duplication here and in the other test.\n\nFor example:\n\n def _create_sensor_object(self, value, type_, name, states\u003dNone,\n                           units\u003d\u0027fake_units\u0027, health\u003d0):\n     if states is None:\n         states \u003d []\n\n     return type(\u0027Reading\u0027, (object, ), {\u0027value\u0027: value, \u0027type\u0027: type_,\n                                         \u0027name\u0027: name, \u0027states\u0027: states,\n                                         \u0027units\u0027: units, \u0027health\u0027: health})()\n\n And then on the test_* methods:\n\n reading_1 \u003d self._create_sensor_object(\u0027fake_value1\u0027, \u0027fake_type_A\u0027, \u0027fake_name1\u0027)\n reading_2 \u003d self._create_sensor_object(\u0027fake_value2\u0027, \u0027fake_type_A\u0027, \u0027fake_name2\u0027)","commit_id":"13882ec504f968bc66281dadb73dedcc03551c02"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"0b5f165ca9fd4fa792cdc69bf46cc71c2837758f","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        reading_3.name \u003d \u0027fake_name_3\u0027"},{"line_number":157,"context_line":"        reading_3.states \u003d []"},{"line_number":158,"context_line":"        reading_3.units \u003d \u0027fake_units\u0027"},{"line_number":159,"context_line":"        reading_3.health \u003d 0"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"        readings \u003d [reading_1, reading_2, reading_3]"},{"line_number":162,"context_line":"        ipmicmd \u003d ipmi_mock.return_value"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa98f980_5aeda98a","line":159,"in_reply_to":"fa98f980_ba4f75bc","updated":"2014-09-02 10:58:28.000000000","message":"yup, I create the object using type() directly.","commit_id":"13882ec504f968bc66281dadb73dedcc03551c02"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"9628586af25e6704046c34cf13f717e30d28e964","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        reading_3.name \u003d \u0027fake_name_3\u0027"},{"line_number":157,"context_line":"        reading_3.states \u003d []"},{"line_number":158,"context_line":"        reading_3.units \u003d \u0027fake_units\u0027"},{"line_number":159,"context_line":"        reading_3.health \u003d 0"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"        readings \u003d [reading_1, reading_2, reading_3]"},{"line_number":162,"context_line":"        ipmicmd \u003d ipmi_mock.return_value"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa98f980_316aaab3","line":159,"in_reply_to":"fa98f980_d5e7e7e2","updated":"2014-09-03 01:23:18.000000000","message":"Lucas, good idea, make sense, thank you.","commit_id":"13882ec504f968bc66281dadb73dedcc03551c02"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"b6e27b656272d6c7e483cb5209bc70e638cba150","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        reading_3.name \u003d \u0027fake_name_3\u0027"},{"line_number":157,"context_line":"        reading_3.states \u003d []"},{"line_number":158,"context_line":"        reading_3.units \u003d \u0027fake_units\u0027"},{"line_number":159,"context_line":"        reading_3.health \u003d 0"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"        readings \u003d [reading_1, reading_2, reading_3]"},{"line_number":162,"context_line":"        ipmicmd \u003d ipmi_mock.return_value"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa98f980_ba4f75bc","line":159,"in_reply_to":"fa98f980_d5e7e7e2","updated":"2014-09-02 10:56:41.000000000","message":"we don\u0027t even need a class here, just a helper function","commit_id":"13882ec504f968bc66281dadb73dedcc03551c02"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"0d8d1d4af101f86dd6ba4fb74f1f0f0a125f6d87","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        reading_3.name \u003d \u0027fake_name_3\u0027"},{"line_number":218,"context_line":"        reading_3.states \u003d []"},{"line_number":219,"context_line":"        reading_3.units \u003d \u0027fake_units\u0027"},{"line_number":220,"context_line":"        reading_3.health \u003d 0"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"        readings \u003d [reading_1, reading_2, reading_3]"},{"line_number":223,"context_line":"        ipmicmd \u003d ipmi_mock.return_value"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa98f980_58bece00","line":220,"updated":"2014-09-01 13:57:39.000000000","message":"ditto about helper class to avoid code duplication","commit_id":"13882ec504f968bc66281dadb73dedcc03551c02"}]}
