)]}'
{"ironic/drivers/modules/iboot.py":[{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"unresolved":false,"context_lines":[{"line_number":27,"context_line":"from ironic.openstack.common import importutils"},{"line_number":28,"context_line":"from ironic.openstack.common import log as logging"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"iboot \u003d importutils.try_import(\u0027iboot\u0027)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAVn%2F%2B9ZA%3D","line":30,"updated":"2014-03-11 02:04:59.000000000","message":"I\u0027ve tested this use of importutils and it is insufficient given how stevedore is loading drivers in Ironic.","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    if not address or not username or not password:"},{"line_number":43,"context_line":"        raise exception.InvalidParameterValue(_("},{"line_number":44,"context_line":"              \"iBoot credentials not supplied to iBoot PDU driver.\"))"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    relay_id \u003d info.get(\u0027iboot_relay_id\u0027, 1)"},{"line_number":47,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2Fv%2BY%3D","line":44,"updated":"2013-10-29 17:16:49.000000000","message":"Maybe it will make sense to specify the required set of credentials (iboot_address, iboot_username, iboot_password). Or, even the better way, to say which ones were not supplied..","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        raise exception.InvalidParameterValue(_("},{"line_number":51,"context_line":"              \"iBoot PDU relay id must be an integer.\"))"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    port \u003d info.get(\u0027iboot_port\u0027, 9100)"},{"line_number":54,"context_line":"    try:"},{"line_number":55,"context_line":"        port \u003d int(port)"},{"line_number":56,"context_line":"    except ValueError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FvgU%3D","line":53,"updated":"2013-10-29 17:16:49.000000000","message":"Can these 9100 default port depend of iBoot version? Maybe move this to config?","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"84856e0363c638cd4922fb9f168bfcff0262ac9c","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    \"\"\""},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    _conn \u003d None"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _get_connection(self):"},{"line_number":84,"context_line":"        if not self._conn:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9RZA%3D","line":81,"updated":"2013-12-13 08:41:11.000000000","message":"We dont can easily share this connection because IBootPower class is instantiated only once.","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _get_connection(self):"},{"line_number":84,"context_line":"        if not self._conn:"},{"line_number":85,"context_line":"            self._conn \u003d iboot.iBootInterface(self.address, self.user,"},{"line_number":86,"context_line":"                                             self.password, port\u003dself.port,"},{"line_number":87,"context_line":"                                             num_relays\u003dself.relay_id)"},{"line_number":88,"context_line":"        return self._conn"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAVn%2F%2B9Yo%3D","line":85,"updated":"2014-03-11 02:04:59.000000000","message":"this will raise an exception if importutils was not able to import iboot.\n\nAlso, note that the driver is a singleton, instantiated by stevedore on load. You can\u0027t use a class member to store the connection to a specific iBoot device. You could use a dict to store multiple connection objects given a hash of the parameters, perhaps...","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        if not self._conn:"},{"line_number":85,"context_line":"            self._conn \u003d iboot.iBootInterface(self.address, self.user,"},{"line_number":86,"context_line":"                                             self.password, port\u003dself.port,"},{"line_number":87,"context_line":"                                             num_relays\u003dself.relay_id)"},{"line_number":88,"context_line":"        return self._conn"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def _switch(self, relay_id, enabled):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2Fvt0%3D","line":87,"updated":"2013-10-29 17:16:49.000000000","message":"It seems there are no self.address, self.user, self.password, self.port and self.relay_id","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def _switch(self, relay_id, enabled):"},{"line_number":91,"context_line":"        conn \u003d self._get_connection()"},{"line_number":92,"context_line":"        return conn.switch(relay_id, enabled)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _power_status(self, relay_id):"},{"line_number":95,"context_line":"        conn \u003d self._get_connection()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2Fvkc%3D","line":92,"updated":"2013-10-29 17:16:49.000000000","message":"How do you think do we need to protect ourselves from some exceptions here?","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _power_status(self, relay_id):"},{"line_number":95,"context_line":"        conn \u003d self._get_connection()"},{"line_number":96,"context_line":"        status \u003d conn.get_relays()[relay_id - 1]"},{"line_number":97,"context_line":"        if status:"},{"line_number":98,"context_line":"            return states.POWER_ON"},{"line_number":99,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2Fvjo%3D","line":96,"updated":"2013-10-29 17:16:49.000000000","message":"ditto regarding possible exceptions (or impossible\u003d) )","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        _parse_driver_info(node)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def get_power_state(self, task, node):"},{"line_number":111,"context_line":"        \"\"\"Get the current power state.\"\"\""},{"line_number":112,"context_line":"        relay_id \u003d _parse_driver_info(node)[\u0027relay_id\u0027]"},{"line_number":113,"context_line":"        return self._power_status(relay_id)"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FvtY%3D","line":111,"updated":"2013-10-29 17:16:49.000000000","message":"1. Parameters are not mentioned\n2. :raises: InvalidParameterValue too","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        relay_id \u003d _parse_driver_info(node)[\u0027relay_id\u0027]"},{"line_number":113,"context_line":"        return self._power_status(relay_id)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    @task_manager.require_exclusive_lock"},{"line_number":116,"context_line":"    def set_power_state(self, task, node, pstate):"},{"line_number":117,"context_line":"        \"\"\"Turn the power on or off.\"\"\""},{"line_number":118,"context_line":"        relay_id \u003d _parse_driver_info(node)[\u0027relay_id\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2Fvms%3D","line":115,"updated":"2013-10-29 17:16:49.000000000","message":"Would it be better to apply require_exclusive_lock to self._switch() to not to miss it in future?","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    @task_manager.require_exclusive_lock"},{"line_number":116,"context_line":"    def set_power_state(self, task, node, pstate):"},{"line_number":117,"context_line":"        \"\"\"Turn the power on or off.\"\"\""},{"line_number":118,"context_line":"        relay_id \u003d _parse_driver_info(node)[\u0027relay_id\u0027]"},{"line_number":119,"context_line":"        if pstate \u003d\u003d states.POWER_ON:"},{"line_number":120,"context_line":"            self._switch(relay_id, True)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FvtI%3D","line":117,"updated":"2013-10-29 17:16:49.000000000","message":"ditto regarding params and exceptions","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                  \"set_power_state called with invalid \""},{"line_number":126,"context_line":"                  \"power state %s.\") % pstate)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        state \u003d self._power_status(relay_id)"},{"line_number":129,"context_line":"        if state !\u003d pstate:"},{"line_number":130,"context_line":"            raise exception.PowerStateFailure(pstate\u003dpstate)"},{"line_number":131,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FvpU%3D","line":128,"updated":"2013-10-29 17:16:49.000000000","message":"Maybe we can get the resulting status from the self._switch() return value?","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        if state !\u003d pstate:"},{"line_number":130,"context_line":"            raise exception.PowerStateFailure(pstate\u003dpstate)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    @task_manager.require_exclusive_lock"},{"line_number":133,"context_line":"    def reboot(self, task, node):"},{"line_number":134,"context_line":"        \"\"\"Cycles the power to a node.\"\"\""},{"line_number":135,"context_line":"        relay_id \u003d _parse_driver_info(node)[\u0027relay_id\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FvmE%3D","line":132,"updated":"2013-10-29 17:16:49.000000000","message":"ditto regarding moving require_exclusive_lock to self._switch()","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    @task_manager.require_exclusive_lock"},{"line_number":133,"context_line":"    def reboot(self, task, node):"},{"line_number":134,"context_line":"        \"\"\"Cycles the power to a node.\"\"\""},{"line_number":135,"context_line":"        relay_id \u003d _parse_driver_info(node)[\u0027relay_id\u0027]"},{"line_number":136,"context_line":"        self._switch(relay_id, False)"},{"line_number":137,"context_line":"        self._switch(relay_id, True)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FvtA%3D","line":134,"updated":"2013-10-29 17:16:49.000000000","message":"ditto regarding params and exceptions","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        self._switch(relay_id, False)"},{"line_number":137,"context_line":"        self._switch(relay_id, True)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        state \u003d self._power_status(relay_id)"},{"line_number":140,"context_line":"        if state !\u003d states.POWER_ON:"},{"line_number":141,"context_line":"            raise exception.PowerStateFailure(pstate\u003dstates.POWER_ON)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FvjQ%3D","line":139,"updated":"2013-10-29 17:16:49.000000000","message":"ditto regarding getting the result from _switch return","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"# Copyright 2013 Red Hat, Inc."}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_8070cf41","line":1,"updated":"2014-07-22 21:59:27.000000000","message":"does not need #! line or vim: line, and this file is missing the :coding: line","commit_id":"51b11897a2a62b94b1fa0a98b657bbce646ea1ac"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"unresolved":false,"context_lines":[{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def _parse_driver_info(node):"},{"line_number":37,"context_line":"    info \u003d node.driver_info or {}"},{"line_number":38,"context_line":"    address \u003d info.get(\u0027iboot_address\u0027, None)"},{"line_number":39,"context_line":"    username \u003d info.get(\u0027iboot_username\u0027, None)"}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_80a7efa6","line":36,"updated":"2014-07-22 21:59:27.000000000","message":"this will need to be updated to cooperate with the new API whereby drivers expose the parameters they expect, which is about to land","commit_id":"51b11897a2a62b94b1fa0a98b657bbce646ea1ac"}],"ironic/tests/drivers/test_iboot.py":[{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        self.assertRaises(exception.InvalidParameterValue,"},{"line_number":95,"context_line":"                          iboot._parse_driver_info,"},{"line_number":96,"context_line":"                          node)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"class IBootDriverTestCase(db_base.DbTestCase):"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2Fvek%3D","line":97,"updated":"2013-10-29 17:16:49.000000000","message":"There are no iboot_port and iboot_relay_id in the ironic/tests/db/utils.iboot_info, so the real flow, when these options are ints is never tested (test__parse_driver_info_good tests that defaults are not None, but not that the ints can be parsed from driver_info). I\u0027d like to suggest to add two test cases for this.","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        self.node \u003d self.dbapi.create_node(n)"},{"line_number":110,"context_line":"        self.info \u003d iboot._parse_driver_info(self.node)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def test_set_power_state_good(self):"},{"line_number":113,"context_line":"        with mock.patch.object(iboot.IBootPower, \u0027_switch\u0027) as mock_switch:"},{"line_number":114,"context_line":"            with mock.patch.object(iboot.IBootPower, \u0027_get_connection\u0027):"},{"line_number":115,"context_line":"                with mock.patch.object(iboot.IBootPower, \u0027_power_status\u0027) \\"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FvYc%3D","line":112,"updated":"2013-10-29 17:16:49.000000000","message":"Maybe it would be better to apply @patch decorator instead of nested WITH. In this case the mocked objects are passed to a function as positional args","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"ac0fc9068f44d2b1e8264ece55473c6cabc010ad","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        with mock.patch.object(iboot.IBootPower, \u0027_switch\u0027) as mock_switch:"},{"line_number":114,"context_line":"            with mock.patch.object(iboot.IBootPower, \u0027_get_connection\u0027):"},{"line_number":115,"context_line":"                with mock.patch.object(iboot.IBootPower, \u0027_power_status\u0027) \\"},{"line_number":116,"context_line":"                        as mock_on:"},{"line_number":117,"context_line":"                    mock_on.return_value \u003d states.POWER_ON"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"                    with task_manager.acquire([self.node[\u0027uuid\u0027]]) as task:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FvW0%3D","line":116,"updated":"2013-10-29 17:16:49.000000000","message":"I\u0027d like to suggest to rename mock_on to mock_power_status since it\u0027s hard to read the test now","commit_id":"8eb81a5907b4c95591a36096c7925d8e82f43135"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"# Copyright 2013 Red Hat, Inc."},{"line_number":5,"context_line":"# All Rights Reserved."}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_00b3dfe9","line":2,"updated":"2014-07-22 21:59:27.000000000","message":"ditto - doesn\u0027t need these two lines, but may have a :coding: line","commit_id":"51b11897a2a62b94b1fa0a98b657bbce646ea1ac"}]}
