)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"80c518b493104b4c08be1c436cfa7946bc0f7c41","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Target cell in conductor cold migrate"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This adds a decorator that lets us auto-target cells for methods in conductor that"},{"line_number":10,"context_line":"are supposed to run at super-conductor level and thus need to look up the instance"},{"line_number":11,"context_line":"mapping."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I1c9a16b90774fb76e96b36259327dc0f273ab3c8"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"da36d5c6_2b130f0f","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":82},"updated":"2017-02-27 21:23:19.000000000","message":"Line width","commit_id":"08f4b1c191ecc13fc3e72ea63a16d6d319fa5d09"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"53fb4d656c1609ccc592cbfcd80119e39a48a0e0","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Parent:     b473012e (Make consoleauth target the proper cell)"},{"line_number":2,"context_line":"Author:     Dan Smith \u003cdansmith@redhat.com\u003e"},{"line_number":3,"context_line":"AuthorDate: 2017-02-23 14:25:41 -0800"},{"line_number":4,"context_line":"Commit:     Dan Smith \u003cdansmith@redhat.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"ba2be162_4b4a1957","line":1,"updated":"2017-03-06 16:28:02.000000000","message":"blueprint?","commit_id":"c3a3e3e4ff8d47c55464380874c5223ba83e7021"}],"nova/conductor/manager.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"666ce0f195d2d90ccf4c845755b57ea0d995eca8","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    and automatically targets the context with the instance\u0027s cell"},{"line_number":61,"context_line":"    mapping. It does this by looking up the InstanceMapping."},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    def rapper(self, context, *args, **kwargs):"},{"line_number":64,"context_line":"        instance \u003d kwargs.get(\u0027instance\u0027) or args[0]"},{"line_number":65,"context_line":"        im \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":66,"context_line":"            context, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_4874d4ce","line":63,"range":{"start_line":63,"start_character":8,"end_line":63,"end_character":14},"updated":"2017-02-28 17:06:00.000000000","message":"Because it supports a big chain ?\n\nhttp://kingofwallpapers.com/rapper/rapper-011.jpg","commit_id":"f836ded8ac76a9ee71623f27f19c7ebf1a44fcbf"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3a4570e69184042250fc731c0fa96a10453d374d","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    and automatically targets the context with the instance\u0027s cell"},{"line_number":61,"context_line":"    mapping. It does this by looking up the InstanceMapping."},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    def rapper(self, context, *args, **kwargs):"},{"line_number":64,"context_line":"        instance \u003d kwargs.get(\u0027instance\u0027) or args[0]"},{"line_number":65,"context_line":"        im \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":66,"context_line":"            context, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_5e23aa05","line":63,"range":{"start_line":63,"start_character":8,"end_line":63,"end_character":14},"in_reply_to":"ba2be162_4874d4ce","updated":"2017-02-28 17:44:43.000000000","message":"Sure :)","commit_id":"f836ded8ac76a9ee71623f27f19c7ebf1a44fcbf"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"666ce0f195d2d90ccf4c845755b57ea0d995eca8","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    def rapper(self, context, *args, **kwargs):"},{"line_number":64,"context_line":"        instance \u003d kwargs.get(\u0027instance\u0027) or args[0]"},{"line_number":65,"context_line":"        im \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":66,"context_line":"            context, instance.uuid)"},{"line_number":67,"context_line":"        LOG.debug(\u0027Targeting cell %(cell)s for conductor method %(meth)s\u0027,"},{"line_number":68,"context_line":"                  {\u0027cell\u0027: im.cell_mapping,"},{"line_number":69,"context_line":"                   \u0027meth\u0027: fn.__name__})"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_482214bb","line":66,"updated":"2017-02-28 17:06:00.000000000","message":"We could raise some exception here, worth handling it, nope ?","commit_id":"f836ded8ac76a9ee71623f27f19c7ebf1a44fcbf"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3a4570e69184042250fc731c0fa96a10453d374d","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    def rapper(self, context, *args, **kwargs):"},{"line_number":64,"context_line":"        instance \u003d kwargs.get(\u0027instance\u0027) or args[0]"},{"line_number":65,"context_line":"        im \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":66,"context_line":"            context, instance.uuid)"},{"line_number":67,"context_line":"        LOG.debug(\u0027Targeting cell %(cell)s for conductor method %(meth)s\u0027,"},{"line_number":68,"context_line":"                  {\u0027cell\u0027: im.cell_mapping,"},{"line_number":69,"context_line":"                   \u0027meth\u0027: fn.__name__})"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_5e6aca1b","line":66,"in_reply_to":"ba2be162_482214bb","updated":"2017-02-28 17:44:43.000000000","message":"Yeah, I\u0027m not sure what to do, maybe just log and leave it untargeted.","commit_id":"f836ded8ac76a9ee71623f27f19c7ebf1a44fcbf"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e4560e62867f2cc5c0fc441f6943bff1ea3fe139","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    def rapper(self, context, *args, **kwargs):"},{"line_number":64,"context_line":"        instance \u003d kwargs.get(\u0027instance\u0027) or args[0]"},{"line_number":65,"context_line":"        im \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":66,"context_line":"            context, instance.uuid)"},{"line_number":67,"context_line":"        LOG.debug(\u0027Targeting cell %(cell)s for conductor method %(meth)s\u0027,"},{"line_number":68,"context_line":"                  {\u0027cell\u0027: im.cell_mapping,"},{"line_number":69,"context_line":"                   \u0027meth\u0027: fn.__name__})"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_de6a211a","line":66,"in_reply_to":"ba2be162_5e6aca1b","updated":"2017-03-01 08:50:44.000000000","message":"Yeah, that was my thought, sorry for not having it provided in the comment.","commit_id":"f836ded8ac76a9ee71623f27f19c7ebf1a44fcbf"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"6f720f9533aadc96060e92900070077cd4daf438","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    and automatically targets the context with the instance\u0027s cell"},{"line_number":61,"context_line":"    mapping. It does this by looking up the InstanceMapping."},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    def rapper(self, context, *args, **kwargs):"},{"line_number":64,"context_line":"        instance \u003d kwargs.get(\u0027instance\u0027) or args[0]"},{"line_number":65,"context_line":"        try:"},{"line_number":66,"context_line":"            im \u003d objects.InstanceMapping.get_by_instance_uuid("}],"source_content_type":"text/x-python","patch_set":4,"id":"ba2be162_391277b5","line":63,"updated":"2017-03-01 09:11:40.000000000","message":"Given you directly introspect f.__name__ below, it will work correctly, but if you need to access the docstrings or some other magic attributes of the wrapped function in a later call, you won\u0027t get them because you haven\u0027t wrapped the wrapping function into the wrapped one.\n\nProbably worth adding a functools.wraps decorator on top of rapper definition so that we wouldn\u0027t get problems later.","commit_id":"6acbb9aacab1740407c59f3c2ff44a6305d1979d"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"6f720f9533aadc96060e92900070077cd4daf438","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        except exception.InstanceMappingNotFound:"},{"line_number":69,"context_line":"            LOG.error(_LE(\u0027InstanceMapping not found, unable to target cell\u0027),"},{"line_number":70,"context_line":"                      instance\u003dinstance)"},{"line_number":71,"context_line":"            im \u003d None"},{"line_number":72,"context_line":"        else:"},{"line_number":73,"context_line":"            LOG.debug(\u0027Targeting cell %(cell)s for conductor method %(meth)s\u0027,"},{"line_number":74,"context_line":"                      {\u0027cell\u0027: im.cell_mapping,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba2be162_79206f9c","line":71,"range":{"start_line":71,"start_character":0,"end_line":71,"end_character":21},"updated":"2017-03-01 09:11:40.000000000","message":"it\u0027s not needed given the else clause, right?","commit_id":"6acbb9aacab1740407c59f3c2ff44a6305d1979d"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"6f720f9533aadc96060e92900070077cd4daf438","unresolved":false,"context_lines":[{"line_number":248,"context_line":"        exception.UnsupportedPolicyException)"},{"line_number":249,"context_line":"    @targets_cell"},{"line_number":250,"context_line":"    @wrap_instance_event(prefix\u003d\u0027conductor\u0027)"},{"line_number":251,"context_line":"    def migrate_server(self, context, instance, scheduler_hint, live, rebuild,"},{"line_number":252,"context_line":"            flavor, block_migration, disk_over_commit, reservations\u003dNone,"},{"line_number":253,"context_line":"            clean_shutdown\u003dTrue, request_spec\u003dNone):"},{"line_number":254,"context_line":"        if instance and not isinstance(instance, nova_object.NovaObject):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba2be162_cbf2629a","line":251,"updated":"2017-03-01 09:11:40.000000000","message":"My point above about @wraps is maybe bikeshed given it\u0027s wrapping a RPC server handler method but I could imagine a decorator on top of target_cells that would require to introspect the method name and would figure out that its name is \"rapper\" and not \"migrate_server\".","commit_id":"6acbb9aacab1740407c59f3c2ff44a6305d1979d"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"81063f94a7c28f0cdd0fb0ea3d32e833e130810f","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    and automatically targets the context with the instance\u0027s cell"},{"line_number":61,"context_line":"    mapping. It does this by looking up the InstanceMapping."},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    def rapper(self, context, *args, **kwargs):"},{"line_number":64,"context_line":"        instance \u003d kwargs.get(\u0027instance\u0027) or args[0]"},{"line_number":65,"context_line":"        try:"},{"line_number":66,"context_line":"            im \u003d objects.InstanceMapping.get_by_instance_uuid("}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_1b667ded","line":63,"updated":"2017-03-07 18:39:37.000000000","message":"s/rapper/wrapper/g? :)","commit_id":"7dc01b5256669f22d65127115bafcddaf34016ae"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"eb899aec3167dc7c496a33edc7547dba0c4a1d00","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    and automatically targets the context with the instance\u0027s cell"},{"line_number":61,"context_line":"    mapping. It does this by looking up the InstanceMapping."},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    def rapper(self, context, *args, **kwargs):"},{"line_number":64,"context_line":"        instance \u003d kwargs.get(\u0027instance\u0027) or args[0]"},{"line_number":65,"context_line":"        try:"},{"line_number":66,"context_line":"            im \u003d objects.InstanceMapping.get_by_instance_uuid("}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_bb0c9195","line":63,"in_reply_to":"9a30ddce_1b667ded","updated":"2017-03-07 18:43:37.000000000","message":"Intentional :)","commit_id":"7dc01b5256669f22d65127115bafcddaf34016ae"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"0af0ffed554ce2ec6483bd637e1bea28f4b47abf","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    and automatically targets the context with the instance\u0027s cell"},{"line_number":61,"context_line":"    mapping. It does this by looking up the InstanceMapping."},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    def rapper(self, context, *args, **kwargs):"},{"line_number":64,"context_line":"        instance \u003d kwargs.get(\u0027instance\u0027) or args[0]"},{"line_number":65,"context_line":"        try:"},{"line_number":66,"context_line":"            im \u003d objects.InstanceMapping.get_by_instance_uuid("}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_6730a002","line":63,"updated":"2017-03-08 11:21:48.000000000","message":"nit: wrapper?\n\nAlso, @functools.wraps(fn) ?","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e9751eb36e4047103c20add9f9fa8c8251589e81","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    and automatically targets the context with the instance\u0027s cell"},{"line_number":61,"context_line":"    mapping. It does this by looking up the InstanceMapping."},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    def rapper(self, context, *args, **kwargs):"},{"line_number":64,"context_line":"        instance \u003d kwargs.get(\u0027instance\u0027) or args[0]"},{"line_number":65,"context_line":"        try:"},{"line_number":66,"context_line":"            im \u003d objects.InstanceMapping.get_by_instance_uuid("}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_231053a8","line":63,"in_reply_to":"9a30ddce_208769d8","updated":"2017-03-08 15:13:03.000000000","message":"Because when I was testing, I needed to see the name of this in the stack trace to work out a bug and never added it back in.\n\nThis is at the bottom of a massive stack. Mind if I queue a fix at the end?","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"cfea63edb5ddeddb99609e588bd6d6504c734c0e","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    and automatically targets the context with the instance\u0027s cell"},{"line_number":61,"context_line":"    mapping. It does this by looking up the InstanceMapping."},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    def rapper(self, context, *args, **kwargs):"},{"line_number":64,"context_line":"        instance \u003d kwargs.get(\u0027instance\u0027) or args[0]"},{"line_number":65,"context_line":"        try:"},{"line_number":66,"context_line":"            im \u003d objects.InstanceMapping.get_by_instance_uuid("}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_83abbf1c","line":63,"in_reply_to":"9a30ddce_231053a8","updated":"2017-03-08 15:17:54.000000000","message":"By all means.","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ed77724c0e8b17a28c61b6eb10307087d188f652","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    and automatically targets the context with the instance\u0027s cell"},{"line_number":61,"context_line":"    mapping. It does this by looking up the InstanceMapping."},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    def rapper(self, context, *args, **kwargs):"},{"line_number":64,"context_line":"        instance \u003d kwargs.get(\u0027instance\u0027) or args[0]"},{"line_number":65,"context_line":"        try:"},{"line_number":66,"context_line":"            im \u003d objects.InstanceMapping.get_by_instance_uuid("}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_a068b988","line":63,"in_reply_to":"9a30ddce_6730a002","updated":"2017-03-08 14:35:04.000000000","message":"The name is intentional, but so many people have commented that I guess I should change it :(","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"448b724c5b68492ce437026adbd42dcb9c7f698a","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    and automatically targets the context with the instance\u0027s cell"},{"line_number":61,"context_line":"    mapping. It does this by looking up the InstanceMapping."},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    def rapper(self, context, *args, **kwargs):"},{"line_number":64,"context_line":"        instance \u003d kwargs.get(\u0027instance\u0027) or args[0]"},{"line_number":65,"context_line":"        try:"},{"line_number":66,"context_line":"            im \u003d objects.InstanceMapping.get_by_instance_uuid("}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_208769d8","line":63,"in_reply_to":"9a30ddce_a068b988","updated":"2017-03-08 15:04:20.000000000","message":"I was pretty sure it was intentional, I just couldn\u0027t think why :)\n\nWhy did you omit functools.wraps() ?","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"65b20a823d90185d99da4907d90250302e8765c2","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            im \u003d None"},{"line_number":72,"context_line":"        else:"},{"line_number":73,"context_line":"            LOG.debug(\u0027Targeting cell %(cell)s for conductor method %(meth)s\u0027,"},{"line_number":74,"context_line":"                      {\u0027cell\u0027: im.cell_mapping,"},{"line_number":75,"context_line":"                       \u0027meth\u0027: fn.__name__})"},{"line_number":76,"context_line":"            nova_context.set_target_cell(context, im.cell_mapping)"},{"line_number":77,"context_line":"        return fn(self, context, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_1409be31","line":74,"range":{"start_line":74,"start_character":31,"end_line":74,"end_character":46},"updated":"2017-03-08 18:26:13.000000000","message":"This goes back to the discussion with melwitt about not wanting to log the full cell mapping b/c of the creds in transport_url and database_connection, do you want to avoid that, or don\u0027t care? If we use SenstiveStringField on those, as you have elsewhere, and we get mask_password to know about URLs, then it would be fine.","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5b16890a51c2908e7f663fb0dc93bab64afe8388","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            im \u003d None"},{"line_number":72,"context_line":"        else:"},{"line_number":73,"context_line":"            LOG.debug(\u0027Targeting cell %(cell)s for conductor method %(meth)s\u0027,"},{"line_number":74,"context_line":"                      {\u0027cell\u0027: im.cell_mapping,"},{"line_number":75,"context_line":"                       \u0027meth\u0027: fn.__name__})"},{"line_number":76,"context_line":"            nova_context.set_target_cell(context, im.cell_mapping)"},{"line_number":77,"context_line":"        return fn(self, context, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_3fe93b15","line":74,"range":{"start_line":74,"start_character":31,"end_line":74,"end_character":46},"in_reply_to":"9a30ddce_1409be31","updated":"2017-03-08 18:29:20.000000000","message":"Yeah, I don\u0027t need the full thing here. I did during debug, but I can change it to just uuid.","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"0af0ffed554ce2ec6483bd637e1bea28f4b47abf","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            LOG.debug(\u0027Targeting cell %(cell)s for conductor method %(meth)s\u0027,"},{"line_number":74,"context_line":"                      {\u0027cell\u0027: im.cell_mapping,"},{"line_number":75,"context_line":"                       \u0027meth\u0027: fn.__name__})"},{"line_number":76,"context_line":"            nova_context.set_target_cell(context, im.cell_mapping)"},{"line_number":77,"context_line":"        return fn(self, context, *args, **kwargs)"},{"line_number":78,"context_line":"    return rapper"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_aaddfd15","line":76,"updated":"2017-03-08 11:21:48.000000000","message":"This leaves the context object modified on return from fn(). The scope of the caller is fairly limited, but I feel like this is unexpected and unnecessary given that we\u0027ve got a contextmanager available.\n\nHow about:\n\n  @functools.wraps(fn)\n  def wrapper(self, context, *args, **kwargs):\n    instance \u003d kwargs.get(\u0027instance\u0027) or args[0]\n    try:\n      im \u003d objects.InstanceMapping.get_by_instance_uuid(\n          context, instance.uuid)\n      LOG.debug(\u0027Targeting cell %(cell)s for conductor method %(meth)s\u0027,\n                {\u0027cell\u0027: im.cell_mapping,\n                 \u0027meth\u0027: fn.__name__})\n      with nova_context.target_cell(context, im.cell_mapping):\n        return fn(self, context, *args, **kwargs)\n    except exception.InstanceMappingNotFound:\n      LOG.error(_LE(\u0027InstanceMapping not found, unable to target cell\u0027),\n                instance\u003dinstance)    \n      return fn(self, context, *args, **kwargs)\n\n  return wrapper\n\nAt least we could mimic the behaviour of the contextmanager and put it back again afterwards.","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"65b20a823d90185d99da4907d90250302e8765c2","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            LOG.debug(\u0027Targeting cell %(cell)s for conductor method %(meth)s\u0027,"},{"line_number":74,"context_line":"                      {\u0027cell\u0027: im.cell_mapping,"},{"line_number":75,"context_line":"                       \u0027meth\u0027: fn.__name__})"},{"line_number":76,"context_line":"            nova_context.set_target_cell(context, im.cell_mapping)"},{"line_number":77,"context_line":"        return fn(self, context, *args, **kwargs)"},{"line_number":78,"context_line":"    return rapper"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_5f1a6f6f","line":76,"in_reply_to":"9a30ddce_23ce93b4","updated":"2017-03-08 18:26:13.000000000","message":"Given this required an explanation, it\u0027s probably worth a comment in here so when we ask about it in a years time we\u0027ll remember?","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"448b724c5b68492ce437026adbd42dcb9c7f698a","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            LOG.debug(\u0027Targeting cell %(cell)s for conductor method %(meth)s\u0027,"},{"line_number":74,"context_line":"                      {\u0027cell\u0027: im.cell_mapping,"},{"line_number":75,"context_line":"                       \u0027meth\u0027: fn.__name__})"},{"line_number":76,"context_line":"            nova_context.set_target_cell(context, im.cell_mapping)"},{"line_number":77,"context_line":"        return fn(self, context, *args, **kwargs)"},{"line_number":78,"context_line":"    return rapper"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_23ce93b4","line":76,"in_reply_to":"9a30ddce_601c0114","updated":"2017-03-08 15:04:20.000000000","message":"I guess the calling code is just library code where context has no specific meaning. Personally I\u0027d do it anyway for ill-defined \u0027just in case\u0027 reasons, and so I didn\u0027t have to re-think in the future that the side-effect is ok here. Meh, I suppose this isn\u0027t massively important.","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ed77724c0e8b17a28c61b6eb10307087d188f652","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            LOG.debug(\u0027Targeting cell %(cell)s for conductor method %(meth)s\u0027,"},{"line_number":74,"context_line":"                      {\u0027cell\u0027: im.cell_mapping,"},{"line_number":75,"context_line":"                       \u0027meth\u0027: fn.__name__})"},{"line_number":76,"context_line":"            nova_context.set_target_cell(context, im.cell_mapping)"},{"line_number":77,"context_line":"        return fn(self, context, *args, **kwargs)"},{"line_number":78,"context_line":"    return rapper"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_601c0114","line":76,"in_reply_to":"9a30ddce_aaddfd15","updated":"2017-03-08 14:35:04.000000000","message":"It\u0027s intentional that it\u0027s permanently targeted. Once we have determined what cell this goes to, we really don\u0027t want to ever let anything beyond this point go somewhere else (unless specifically overridden).\n\nThese are RPC call entrypoints, so there\u0027s really no reason to restore the context even if we _did_ want to.","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"65b20a823d90185d99da4907d90250302e8765c2","unresolved":false,"context_lines":[{"line_number":371,"context_line":"            pass"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"    @wrap_instance_event(prefix\u003d\u0027conductor\u0027)"},{"line_number":374,"context_line":"    def live_migrate_instance(self, context, instance, scheduler_hint,"},{"line_number":375,"context_line":"                              block_migration, disk_over_commit, request_spec):"},{"line_number":376,"context_line":"        self._live_migrate(context, instance, scheduler_hint,"},{"line_number":377,"context_line":"                           block_migration, disk_over_commit, request_spec)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_7f4e5370","line":374,"updated":"2017-03-08 18:26:13.000000000","message":"Decorate this?","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5b16890a51c2908e7f663fb0dc93bab64afe8388","unresolved":false,"context_lines":[{"line_number":371,"context_line":"            pass"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"    @wrap_instance_event(prefix\u003d\u0027conductor\u0027)"},{"line_number":374,"context_line":"    def live_migrate_instance(self, context, instance, scheduler_hint,"},{"line_number":375,"context_line":"                              block_migration, disk_over_commit, request_spec):"},{"line_number":376,"context_line":"        self._live_migrate(context, instance, scheduler_hint,"},{"line_number":377,"context_line":"                           block_migration, disk_over_commit, request_spec)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_7f3813a1","line":374,"in_reply_to":"9a30ddce_7f4e5370","updated":"2017-03-08 18:29:20.000000000","message":"We can, but I haven\u0027t gotten this tested yet and so I wanted to focus on just the things needed for a normal tempest run first.","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"65b20a823d90185d99da4907d90250302e8765c2","unresolved":false,"context_lines":[{"line_number":520,"context_line":"                inst_mapping.save()"},{"line_number":521,"context_line":"        return inst_mapping"},{"line_number":522,"context_line":""},{"line_number":523,"context_line":"    def build_instances(self, context, instances, image, filter_properties,"},{"line_number":524,"context_line":"            admin_password, injected_files, requested_networks,"},{"line_number":525,"context_line":"            security_groups, block_device_mapping\u003dNone, legacy_bdm\u003dTrue):"},{"line_number":526,"context_line":"        # TODO(ndipanov): Remove block_device_mapping and legacy_bdm in version"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_bf6febc3","line":523,"updated":"2017-03-08 18:26:13.000000000","message":"Decorate this?","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5b16890a51c2908e7f663fb0dc93bab64afe8388","unresolved":false,"context_lines":[{"line_number":520,"context_line":"                inst_mapping.save()"},{"line_number":521,"context_line":"        return inst_mapping"},{"line_number":522,"context_line":""},{"line_number":523,"context_line":"    def build_instances(self, context, instances, image, filter_properties,"},{"line_number":524,"context_line":"            admin_password, injected_files, requested_networks,"},{"line_number":525,"context_line":"            security_groups, block_device_mapping\u003dNone, legacy_bdm\u003dTrue):"},{"line_number":526,"context_line":"        # TODO(ndipanov): Remove block_device_mapping and legacy_bdm in version"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_ffc5e38d","line":523,"in_reply_to":"9a30ddce_bf6febc3","updated":"2017-03-08 18:29:20.000000000","message":"This is only for cellsv1 which doesn\u0027t want it targeted.","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1838d5e6148e10fa045eb43fc27503d8bbc6207a","unresolved":false,"context_lines":[{"line_number":520,"context_line":"                inst_mapping.save()"},{"line_number":521,"context_line":"        return inst_mapping"},{"line_number":522,"context_line":""},{"line_number":523,"context_line":"    def build_instances(self, context, instances, image, filter_properties,"},{"line_number":524,"context_line":"            admin_password, injected_files, requested_networks,"},{"line_number":525,"context_line":"            security_groups, block_device_mapping\u003dNone, legacy_bdm\u003dTrue):"},{"line_number":526,"context_line":"        # TODO(ndipanov): Remove block_device_mapping and legacy_bdm in version"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a30ddce_9f0947e0","line":523,"in_reply_to":"9a30ddce_ffc5e38d","updated":"2017-03-08 18:30:44.000000000","message":"This is also for reschedules from the compute manager, but at that point you\u0027re already targeted, right?","commit_id":"13c5069fc2d2f0a0dc068b53e69a3830b573ea3d"}],"nova/tests/unit/conductor/test_conductor.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0ca0f495de76c5693cff9365a5b75914c49e91bb","unresolved":false,"context_lines":[{"line_number":331,"context_line":""},{"line_number":332,"context_line":"        return rebuild_args, compute_rebuild_args"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"    @mock.patch.object(objects.InstanceMapping, \u0027get_by_instance_uuid\u0027)"},{"line_number":335,"context_line":"    @mock.patch.object(objects.RequestSpec, \u0027save\u0027)"},{"line_number":336,"context_line":"    @mock.patch.object(migrate.MigrationTask, \u0027execute\u0027)"},{"line_number":337,"context_line":"    @mock.patch.object(utils, \u0027get_image_from_system_metadata\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da36d5c6_766c0b37","line":334,"updated":"2017-02-28 01:34:28.000000000","message":"Should at least one of these have a get_im.assert_called_once_with(...)?  And/or a check for set_target_cell?","commit_id":"f836ded8ac76a9ee71623f27f19c7ebf1a44fcbf"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"6f720f9533aadc96060e92900070077cd4daf438","unresolved":false,"context_lines":[{"line_number":1694,"context_line":"    def test_migrate_server_fails_with_rebuild(self, get_im):"},{"line_number":1695,"context_line":"        get_im.return_value.cell_mapping \u003d ("},{"line_number":1696,"context_line":"            objects.CellMappingList.get_all(self.context)[0])"},{"line_number":1697,"context_line":""},{"line_number":1698,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context,"},{"line_number":1699,"context_line":"                                                   vm_state\u003dvm_states.ACTIVE)"},{"line_number":1700,"context_line":"        self.assertRaises(NotImplementedError, self.conductor.migrate_server,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba2be162_eb7486fe","line":1697,"updated":"2017-03-01 09:11:40.000000000","message":"nit: that extra blank line is not needed.","commit_id":"6acbb9aacab1740407c59f3c2ff44a6305d1979d"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"6f720f9533aadc96060e92900070077cd4daf438","unresolved":false,"context_lines":[{"line_number":2347,"context_line":""},{"line_number":2348,"context_line":"        @conductor_manager.targets_cell"},{"line_number":2349,"context_line":"        def test(self, context, instance):"},{"line_number":2350,"context_line":"            return mock.sentinel.iransofaraway"},{"line_number":2351,"context_line":""},{"line_number":2352,"context_line":"        mock_im.side_effect \u003d exc.InstanceMappingNotFound"},{"line_number":2353,"context_line":"        ctxt \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba2be162_2b9a1e15","line":2350,"range":{"start_line":2350,"start_character":33,"end_line":2350,"end_character":46},"updated":"2017-03-01 09:11:40.000000000","message":"Heh, nice naming.","commit_id":"6acbb9aacab1740407c59f3c2ff44a6305d1979d"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"6f720f9533aadc96060e92900070077cd4daf438","unresolved":false,"context_lines":[{"line_number":2355,"context_line":"        self.assertEqual(mock.sentinel.iransofaraway,"},{"line_number":2356,"context_line":"                         test(None, ctxt, inst))"},{"line_number":2357,"context_line":"        mock_im.assert_called_once_with(ctxt, inst.uuid)"},{"line_number":2358,"context_line":""},{"line_number":2359,"context_line":""},{"line_number":2360,"context_line":"class ConductorTaskAPITestCase(_BaseTaskTestCase, test_compute.BaseTestCase):"},{"line_number":2361,"context_line":"    \"\"\"Compute task API Tests.\"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba2be162_0b639a1b","line":2358,"updated":"2017-03-01 09:11:40.000000000","message":"We could maybe test the decorator positively, by just verifying it sets the target context with the right instance mapping ?","commit_id":"6acbb9aacab1740407c59f3c2ff44a6305d1979d"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"81063f94a7c28f0cdd0fb0ea3d32e833e130810f","unresolved":false,"context_lines":[{"line_number":340,"context_line":"                           migration_task_execute, spec_save, get_im,"},{"line_number":341,"context_line":"                           clean_shutdown\u003dTrue):"},{"line_number":342,"context_line":"        get_im.return_value.cell_mapping \u003d ("},{"line_number":343,"context_line":"            objects.CellMappingList.get_all(self.context)[0])"},{"line_number":344,"context_line":"        get_image_from_metadata.return_value \u003d \u0027image\u0027"},{"line_number":345,"context_line":"        inst \u003d fake_instance.fake_db_instance(image_ref\u003d\u0027image_ref\u0027)"},{"line_number":346,"context_line":"        inst_obj \u003d objects.Instance._from_db_object("}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_7b885923","line":343,"updated":"2017-03-07 18:39:37.000000000","message":"You might consider adding a helper method:\n\n def _get_first_cell_map(self):\n     return objects.CellMappingList.get_all(self.context)[0]\n\nand then DRY\u0027ing up the unit tests with:\n\n get_im.return_value \u003d self._get_first_cell_map()","commit_id":"7dc01b5256669f22d65127115bafcddaf34016ae"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"eb899aec3167dc7c496a33edc7547dba0c4a1d00","unresolved":false,"context_lines":[{"line_number":340,"context_line":"                           migration_task_execute, spec_save, get_im,"},{"line_number":341,"context_line":"                           clean_shutdown\u003dTrue):"},{"line_number":342,"context_line":"        get_im.return_value.cell_mapping \u003d ("},{"line_number":343,"context_line":"            objects.CellMappingList.get_all(self.context)[0])"},{"line_number":344,"context_line":"        get_image_from_metadata.return_value \u003d \u0027image\u0027"},{"line_number":345,"context_line":"        inst \u003d fake_instance.fake_db_instance(image_ref\u003d\u0027image_ref\u0027)"},{"line_number":346,"context_line":"        inst_obj \u003d objects.Instance._from_db_object("}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_db5f8570","line":343,"in_reply_to":"9a30ddce_7b885923","updated":"2017-03-07 18:43:37.000000000","message":"I could, but it\u0027s more code to do that. Usually if pulling out a helper method doesn\u0027t save any lines of code and may obscure what\u0027s really going on (i.e. having to leave the context of this method to go figure out what\u0027s going on) then I don\u0027t consider it a win.","commit_id":"7dc01b5256669f22d65127115bafcddaf34016ae"}]}
