)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"8a9a0451ba5ef2f86e383098b82585e63ced5410","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Ramakrishnan G \u003crameshg87@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-03-30 10:16:13 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Converting inspect_ports to string before string operations"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When a single port is desired in inspect_ports for ilo"},{"line_number":10,"context_line":"inspection, it is stored as an integer.  This commit changes"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"da9b358b_b22b4aeb","line":7,"updated":"2015-03-30 13:47:08.000000000","message":"nit: s/Converting/Convert/","commit_id":"06081f236ff81df3bf3cb8b23de819b5702eeb44"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"da60330823f501d4a8746fb31d054cd0fa71575e","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Ramakrishnan G \u003crameshg87@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-03-30 10:16:13 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Converting inspect_ports to string before string operations"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When a single port is desired in inspect_ports for ilo"},{"line_number":10,"context_line":"inspection, it is stored as an integer.  This commit changes"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"da9b358b_7f74669b","line":7,"in_reply_to":"da9b358b_b22b4aeb","updated":"2015-03-30 15:08:04.000000000","message":"Done","commit_id":"06081f236ff81df3bf3cb8b23de819b5702eeb44"}],"ironic/drivers/modules/ilo/inspect.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"8a9a0451ba5ef2f86e383098b82585e63ced5410","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        if \u0027inspect_ports\u0027 not in driver_info:"},{"line_number":304,"context_line":"            raise exception.MissingParameterValue(_("},{"line_number":305,"context_line":"                \"Missing \u0027inspect_ports\u0027 parameter in node\u0027s driver_info.\"))"},{"line_number":306,"context_line":"        value \u003d str(driver_info[\u0027inspect_ports\u0027])"},{"line_number":307,"context_line":"        if (value.lower() !\u003d \u0027all\u0027 and value.lower() !\u003d \u0027none\u0027"},{"line_number":308,"context_line":"            and not all(s.isdigit() for s in value.split(\u0027,\u0027))):"},{"line_number":309,"context_line":"                raise exception.InvalidParameterValue(_("}],"source_content_type":"text/x-python","patch_set":1,"id":"da9b358b_326e1a30","line":306,"updated":"2015-03-30 13:47:08.000000000","message":"did you try passing something non-latin here? I suspect we might want to catch UnicodeError","commit_id":"06081f236ff81df3bf3cb8b23de819b5702eeb44"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"da60330823f501d4a8746fb31d054cd0fa71575e","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        if \u0027inspect_ports\u0027 not in driver_info:"},{"line_number":304,"context_line":"            raise exception.MissingParameterValue(_("},{"line_number":305,"context_line":"                \"Missing \u0027inspect_ports\u0027 parameter in node\u0027s driver_info.\"))"},{"line_number":306,"context_line":"        value \u003d str(driver_info[\u0027inspect_ports\u0027])"},{"line_number":307,"context_line":"        if (value.lower() !\u003d \u0027all\u0027 and value.lower() !\u003d \u0027none\u0027"},{"line_number":308,"context_line":"            and not all(s.isdigit() for s in value.split(\u0027,\u0027))):"},{"line_number":309,"context_line":"                raise exception.InvalidParameterValue(_("}],"source_content_type":"text/x-python","patch_set":1,"id":"da9b358b_3f57fe03","line":306,"in_reply_to":"da9b358b_326e1a30","updated":"2015-03-30 15:08:04.000000000","message":"I can catch Unicode error here alone as this is validate.  But is this really required ? Can you point me to some examples where str() of something can fail.  This is coming from the DB btw.","commit_id":"06081f236ff81df3bf3cb8b23de819b5702eeb44"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ac3db8c8b50ca008580d8a8f7ed515203984a803","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        if \u0027inspect_ports\u0027 not in driver_info:"},{"line_number":304,"context_line":"            raise exception.MissingParameterValue(_("},{"line_number":305,"context_line":"                \"Missing \u0027inspect_ports\u0027 parameter in node\u0027s driver_info.\"))"},{"line_number":306,"context_line":"        value \u003d str(driver_info[\u0027inspect_ports\u0027])"},{"line_number":307,"context_line":"        if (value.lower() !\u003d \u0027all\u0027 and value.lower() !\u003d \u0027none\u0027"},{"line_number":308,"context_line":"            and not all(s.isdigit() for s in value.split(\u0027,\u0027))):"},{"line_number":309,"context_line":"                raise exception.InvalidParameterValue(_("}],"source_content_type":"text/x-python","patch_set":1,"id":"da9b358b_bfbe6efd","line":306,"in_reply_to":"da9b358b_3f57fe03","updated":"2015-03-30 15:10:34.000000000","message":"maybe s/str/six.text_type/ ?","commit_id":"06081f236ff81df3bf3cb8b23de819b5702eeb44"}],"ironic/tests/drivers/ilo/test_inspect.py":[{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"74329832db35677358990cf73774ad7202968aeb","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    def test_validate_inspect_ports_valid_single(self, driver_info_mock):"},{"line_number":81,"context_line":"        with task_manager.acquire(self.context, self.node.uuid,"},{"line_number":82,"context_line":"                                  shared\u003dFalse) as task:"},{"line_number":83,"context_line":"            # If only a single port, it will be an integer in driver_info."},{"line_number":84,"context_line":"            driver_info_mock.return_value \u003d {\u0027inspect_ports\u0027: 1}"},{"line_number":85,"context_line":"            task.driver.inspect.validate(task)"},{"line_number":86,"context_line":"            driver_info_mock.assert_called_once_with(task.node)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da9b358b_86ffe700","line":83,"updated":"2015-03-30 14:08:05.000000000","message":"Is this necessarily true? It depends on whether or not someone quotes the value or not, right? E.g.,\n\ninspect_ports\u003d1\n\nor\n\ninspect_ports\u003d\u00271\u0027\n\nPerhaps we should test with both a string AND and an int value. This test will pass with either (I checked manually).","commit_id":"06081f236ff81df3bf3cb8b23de819b5702eeb44"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"da60330823f501d4a8746fb31d054cd0fa71575e","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    def test_validate_inspect_ports_valid_single(self, driver_info_mock):"},{"line_number":81,"context_line":"        with task_manager.acquire(self.context, self.node.uuid,"},{"line_number":82,"context_line":"                                  shared\u003dFalse) as task:"},{"line_number":83,"context_line":"            # If only a single port, it will be an integer in driver_info."},{"line_number":84,"context_line":"            driver_info_mock.return_value \u003d {\u0027inspect_ports\u0027: 1}"},{"line_number":85,"context_line":"            task.driver.inspect.validate(task)"},{"line_number":86,"context_line":"            driver_info_mock.assert_called_once_with(task.node)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da9b358b_9cf97850","line":83,"in_reply_to":"da9b358b_86ffe700","updated":"2015-03-30 15:08:04.000000000","message":"Done.\n\nI think it\u0027s always true if we use our python-ironicclient.\n\nhttps://github.com/openstack/python-ironicclient/blob/master/ironicclient/common/utils.py#L96-L101\n\n\"1\" is a json and is converted, whereas \"1,2\" raises valueerror and is used as it is. \n\nI agree that someone can still pass a single port through api and do it.  I will add test cases for it.","commit_id":"06081f236ff81df3bf3cb8b23de819b5702eeb44"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"74329832db35677358990cf73774ad7202968aeb","unresolved":false,"context_lines":[{"line_number":283,"context_line":"        power_mock.return_value \u003d states.POWER_ON"},{"line_number":284,"context_line":"        with task_manager.acquire(self.context, self.node.uuid,"},{"line_number":285,"context_line":"                                  shared\u003dFalse) as task:"},{"line_number":286,"context_line":"            # If only a single port, it will be an integer in driver_info."},{"line_number":287,"context_line":"            task.node.driver_info \u003d {\u0027inspect_ports\u0027: 1}"},{"line_number":288,"context_line":"            task.driver.inspect.inspect_hardware(task)"},{"line_number":289,"context_line":"            power_mock.assert_called_once_with(task)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da9b358b_c61def67","line":286,"updated":"2015-03-30 14:08:05.000000000","message":"Again, not always true.","commit_id":"06081f236ff81df3bf3cb8b23de819b5702eeb44"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"da60330823f501d4a8746fb31d054cd0fa71575e","unresolved":false,"context_lines":[{"line_number":283,"context_line":"        power_mock.return_value \u003d states.POWER_ON"},{"line_number":284,"context_line":"        with task_manager.acquire(self.context, self.node.uuid,"},{"line_number":285,"context_line":"                                  shared\u003dFalse) as task:"},{"line_number":286,"context_line":"            # If only a single port, it will be an integer in driver_info."},{"line_number":287,"context_line":"            task.node.driver_info \u003d {\u0027inspect_ports\u0027: 1}"},{"line_number":288,"context_line":"            task.driver.inspect.inspect_hardware(task)"},{"line_number":289,"context_line":"            power_mock.assert_called_once_with(task)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da9b358b_7c9594e2","line":286,"in_reply_to":"da9b358b_c61def67","updated":"2015-03-30 15:08:04.000000000","message":"Done","commit_id":"06081f236ff81df3bf3cb8b23de819b5702eeb44"}]}
