)]}'
{"ironic/nova/virt/ironic/client_wrapper.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d4fae42a00322f8f331a16e40d68446d73b194e9","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        :raises: NovaException if all retries failed."},{"line_number":78,"context_line":"        \"\"\""},{"line_number":79,"context_line":"        retry_excs \u003d (ironic_exception.HTTPServiceUnavailable,"},{"line_number":80,"context_line":"                      ironic_exception.CommunicationError)"},{"line_number":81,"context_line":"        num_attempts \u003d CONF.ironic.api_max_retries"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        for attempt in xrange(1, num_attempts + 1):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAWH%2F%2BC6M%3D","line":80,"updated":"2014-03-31 10:18:05.000000000","message":"suggestion: Maybe its better to define this as a global? instead of defining it every time call() is called?","commit_id":"7df1bf0b9eec58ec399e51f15d4bdd92c30f70bf"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"936bd8435f5c2313bb7d2306d30bf4f7308bdf21","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        :raises: NovaException if all retries failed."},{"line_number":78,"context_line":"        \"\"\""},{"line_number":79,"context_line":"        retry_excs \u003d (ironic_exception.HTTPServiceUnavailable,"},{"line_number":80,"context_line":"                      ironic_exception.CommunicationError)"},{"line_number":81,"context_line":"        num_attempts \u003d CONF.ironic.api_max_retries"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        for attempt in xrange(1, num_attempts + 1):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAWH%2F%2BCTM%3D","line":80,"in_reply_to":"AAAAWH%2F%2BC6M%3D","updated":"2014-03-31 12:06:56.000000000","message":"I have to politely disagree with this. Though it may at first seem optimal to do as you suggest, doing so would greatly increase the lifetime of a variable that is never referenced anywhere else, making optimizations by the compiler/interpreter more difficult.","commit_id":"7df1bf0b9eec58ec399e51f15d4bdd92c30f70bf"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d4fae42a00322f8f331a16e40d68446d73b194e9","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                      ironic_exception.CommunicationError)"},{"line_number":81,"context_line":"        num_attempts \u003d CONF.ironic.api_max_retries"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        for attempt in xrange(1, num_attempts + 1):"},{"line_number":84,"context_line":"            client \u003d self._get_client()"},{"line_number":85,"context_line":"            try:"},{"line_number":86,"context_line":"                return self._multi_getattr(client, method)(*args)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAWH%2F%2BC68%3D","line":83,"updated":"2014-03-31 10:18:05.000000000","message":"xrange() does not exist in py3, so I would suggest you to use range() (since it\u0027s usually a small range that we are creating and won\u0027t hit any significantly memory/performance problems)\n\nor\n\nimport six\n\nsix.moves.xrange()","commit_id":"7df1bf0b9eec58ec399e51f15d4bdd92c30f70bf"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"936bd8435f5c2313bb7d2306d30bf4f7308bdf21","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                      ironic_exception.CommunicationError)"},{"line_number":81,"context_line":"        num_attempts \u003d CONF.ironic.api_max_retries"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        for attempt in xrange(1, num_attempts + 1):"},{"line_number":84,"context_line":"            client \u003d self._get_client()"},{"line_number":85,"context_line":"            try:"},{"line_number":86,"context_line":"                return self._multi_getattr(client, method)(*args)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAWH%2F%2BCVI%3D","line":83,"in_reply_to":"AAAAWH%2F%2BC68%3D","updated":"2014-03-31 12:06:56.000000000","message":"Very good catch. Done.","commit_id":"7df1bf0b9eec58ec399e51f15d4bdd92c30f70bf"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"d4fae42a00322f8f331a16e40d68446d73b194e9","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                         \"Attempt %(attempt)d of %(total)d\")"},{"line_number":90,"context_line":"                       % {\u0027method\u0027: method,"},{"line_number":91,"context_line":"                          \u0027attempt\u0027: attempt,"},{"line_number":92,"context_line":"                          \u0027total\u0027: CONF.ironic.api_max_retries})"},{"line_number":93,"context_line":"                if attempt \u003d\u003d num_attempts:"},{"line_number":94,"context_line":"                    LOG.error(msg)"},{"line_number":95,"context_line":"                    raise exception.NovaException(msg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAWH%2F%2BC58%3D","line":92,"updated":"2014-03-31 10:18:05.000000000","message":"NIT:\n\ns/CONF.ironic.api_max_retries/num_attempts/g\n\nor use CONF.ironic.api_mac_retries everywhere, the mix looks a bit odd","commit_id":"7df1bf0b9eec58ec399e51f15d4bdd92c30f70bf"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"936bd8435f5c2313bb7d2306d30bf4f7308bdf21","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                         \"Attempt %(attempt)d of %(total)d\")"},{"line_number":90,"context_line":"                       % {\u0027method\u0027: method,"},{"line_number":91,"context_line":"                          \u0027attempt\u0027: attempt,"},{"line_number":92,"context_line":"                          \u0027total\u0027: CONF.ironic.api_max_retries})"},{"line_number":93,"context_line":"                if attempt \u003d\u003d num_attempts:"},{"line_number":94,"context_line":"                    LOG.error(msg)"},{"line_number":95,"context_line":"                    raise exception.NovaException(msg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAWH%2F%2BCVA%3D","line":92,"in_reply_to":"AAAAWH%2F%2BC58%3D","updated":"2014-03-31 12:06:56.000000000","message":"Gah! I thought I replaced all of those already. Thanks.","commit_id":"7df1bf0b9eec58ec399e51f15d4bdd92c30f70bf"},{"author":{"_account_id":5805,"name":"Chris Krelle","email":"nobodycam@gmail.com","username":"nobodycam"},"change_message_id":"f2c2d0f9b0531baef25d55811ae8009b1597824b","unresolved":false,"context_lines":[{"line_number":18,"context_line":"import time"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from ironicclient import client as ironic_client"},{"line_number":21,"context_line":"from ironicclient import exc as ironic_exception"},{"line_number":22,"context_line":"from nova import exception"},{"line_number":23,"context_line":"from nova.openstack.common.gettextutils import _"},{"line_number":24,"context_line":"from nova.openstack.common import log as logging"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWn%2F%2F4Tw%3D","line":21,"updated":"2014-04-08 19:16:51.000000000","message":"would like to see a blank line after the ironic imports and before the nova one. Not worth a -1 but if you push up a new rev. please add one.","commit_id":"c76e2ec69f1a9eadd9c0afbbd00747e5a44338bc"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"6272aa72e4822ca9ff5a3a9722c7a965999fef1c","unresolved":false,"context_lines":[{"line_number":28,"context_line":"CONF \u003d cfg.CONF"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class IronicClientWrapper(object):"},{"line_number":32,"context_line":"    \"\"\"Ironic client wrapper class that encapsulates retry logic.\"\"\""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def _get_client(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F9R0w%3D","line":31,"updated":"2014-04-07 13:25:47.000000000","message":"At least as of now, IronicClientWrapper is not really a class, it it just a namespace. I suggest promoting call to a top level function. This will avoid the need of construction an object every time.\n\nAn alternative could be to make the object cache result of _get_client(), but I\u0027m not sure it is worth doing..","commit_id":"c76e2ec69f1a9eadd9c0afbbd00747e5a44338bc"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"8c1b3c5ae320c8363afdb25d956507a716a7c851","unresolved":false,"context_lines":[{"line_number":28,"context_line":"CONF \u003d cfg.CONF"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class IronicClientWrapper(object):"},{"line_number":32,"context_line":"    \"\"\"Ironic client wrapper class that encapsulates retry logic.\"\"\""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def _get_client(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F9RyE%3D","line":31,"in_reply_to":"AAAAWH%2F9R0w%3D","updated":"2014-04-07 13:50:42.000000000","message":"The intent is to eventually cache the result of _get_client() (see the TODO comment by deva in that method). This class would capture that logic.","commit_id":"c76e2ec69f1a9eadd9c0afbbd00747e5a44338bc"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"5cd519c823247fd76221e839ad14a2a6a3419590","unresolved":false,"context_lines":[{"line_number":28,"context_line":"CONF \u003d cfg.CONF"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class IronicClientWrapper(object):"},{"line_number":32,"context_line":"    \"\"\"Ironic client wrapper class that encapsulates retry logic.\"\"\""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def _get_client(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F9RW0%3D","line":31,"in_reply_to":"AAAAWH%2F9RyE%3D","updated":"2014-04-07 14:12:18.000000000","message":"ack","commit_id":"c76e2ec69f1a9eadd9c0afbbd00747e5a44338bc"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"bcda6dc32309557c7afdd09dd3ce235b5448d5c8","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                msg \u003d (_(\"Bad API request for method \u0027%(method)s\u0027.\")"},{"line_number":101,"context_line":"                       % {\u0027method\u0027: method})"},{"line_number":102,"context_line":"                LOG.error(msg)"},{"line_number":103,"context_line":"                raise exception.NovaException(msg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAW3%2F%2F0Fk%3D","line":103,"updated":"2014-04-10 08:48:19.000000000","message":"I think we should raise different types of exceptions here, or not handle BadRequest in this wrapper.\n\nSometimes in the driver we need to ignore the BadRequest from the client, it\u0027s not an error, it could be part of the working flow... If the deploy fails in the spawn(), the method clean_up() will be called and it will try to unplug_vifs(), but if it failed before the plug_vifs() method the unplug_vifs() will raise a bad request because you\u0027re trying to remove a field that doesn\u0027t exist in that node, so in that case we should just pass and ignore the HTTPBadRequest error, the same for the instance_uuid field.\n\nSo we need a way to differentiate a HTTPBadRequest from a HTTPServiceUnabailable/Communication error, raising a NovaException on both cases will make it difficult.","commit_id":"7da43c398220e486308f8dc4ed8e09f8bd498fc8"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"013ff3703d3ca48318e147053ef74d7f109263a4","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                msg \u003d (_(\"Bad API request for method \u0027%(method)s\u0027.\")"},{"line_number":101,"context_line":"                       % {\u0027method\u0027: method})"},{"line_number":102,"context_line":"                LOG.error(msg)"},{"line_number":103,"context_line":"                raise exception.NovaException(msg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAW3%2F%2FwXM%3D","line":103,"in_reply_to":"AAAAW3%2F%2F0Fk%3D","updated":"2014-04-10 15:46:44.000000000","message":"Done","commit_id":"7da43c398220e486308f8dc4ed8e09f8bd498fc8"}],"ironic/nova/virt/ironic/driver.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"6272aa72e4822ca9ff5a3a9722c7a965999fef1c","unresolved":false,"context_lines":[{"line_number":319,"context_line":""},{"line_number":320,"context_line":"    def list_instances(self):"},{"line_number":321,"context_line":"        icli \u003d client_wrapper.IronicClientWrapper()"},{"line_number":322,"context_line":"        node_list \u003d icli.call(\"node.list\")"},{"line_number":323,"context_line":"        instances \u003d [i for i in node_list if i.instance_uuid]"},{"line_number":324,"context_line":"        return instances"},{"line_number":325,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F9R0c%3D","line":322,"updated":"2014-04-07 13:25:47.000000000","message":"Just to clarify: are you sure it\u0027s ok to change semantics here? Previously in case of Unauthorized empty list was returned, now an error will be raised.","commit_id":"c76e2ec69f1a9eadd9c0afbbd00747e5a44338bc"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"8c1b3c5ae320c8363afdb25d956507a716a7c851","unresolved":false,"context_lines":[{"line_number":319,"context_line":""},{"line_number":320,"context_line":"    def list_instances(self):"},{"line_number":321,"context_line":"        icli \u003d client_wrapper.IronicClientWrapper()"},{"line_number":322,"context_line":"        node_list \u003d icli.call(\"node.list\")"},{"line_number":323,"context_line":"        instances \u003d [i for i in node_list if i.instance_uuid]"},{"line_number":324,"context_line":"        return instances"},{"line_number":325,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F9Rkk%3D","line":322,"in_reply_to":"AAAAWH%2F9R0c%3D","updated":"2014-04-07 13:50:42.000000000","message":"Yes, it should be safe. The libvirt driver can raise a NovaException from it\u0027s list_instances() method. And Nova\u0027s use of the empty list was basically a NOOP since nothing else was done after the list was processed.\n\nOne of the requirements of this patch is to handle all client exceptions in a consistent manner. By handling it within IronicClientWrapper, *any* client call will that results in Unauthorized will raise a NovaException now.","commit_id":"c76e2ec69f1a9eadd9c0afbbd00747e5a44338bc"}]}
