)]}'
{"nova/compute/api.py":[{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"709e8be1101468173e4efa330005529d6ee53fd4","unresolved":false,"context_lines":[{"line_number":1443,"context_line":""},{"line_number":1444,"context_line":"        # In case we couldn\u0027t find any suitable base_image"},{"line_number":1445,"context_line":"        system_meta.setdefault(\u0027image_base_image_ref\u0027, instance.image_ref)"},{"line_number":1446,"context_line":"        system_meta[\u0027owner_user_name\u0027] \u003d context.user_name"},{"line_number":1447,"context_line":"        system_meta[\u0027owner_project_name\u0027] \u003d context.project_name"},{"line_number":1448,"context_line":""},{"line_number":1449,"context_line":"        instance.system_metadata.update(system_meta)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_32348948","line":1446,"updated":"2017-03-06 09:55:46.000000000","message":"nit: without an empty line after #1445 it may seem that the comment above applies to the lines you are adding as well","commit_id":"ecdfc78e77ad2e4eceb34f10880f701ce990e3aa"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"d3f1e8709779253cda537c9fcb911a5bf42c1553","unresolved":false,"context_lines":[{"line_number":1445,"context_line":"        system_meta.setdefault(\u0027image_base_image_ref\u0027, instance.image_ref)"},{"line_number":1446,"context_line":""},{"line_number":1447,"context_line":"        system_meta[\u0027owner_user_name\u0027] \u003d context.user_name"},{"line_number":1448,"context_line":"        system_meta[\u0027owner_project_name\u0027] \u003d context.project_name"},{"line_number":1449,"context_line":""},{"line_number":1450,"context_line":"        instance.system_metadata.update(system_meta)"},{"line_number":1451,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_1968ee86","line":1448,"updated":"2017-03-09 15:58:48.000000000","message":"Nice.","commit_id":"b89bd14db2801e016f586a12eee580a00e5488b9"}],"nova/tests/unit/virt/libvirt/test_config.py":[{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"f3bee805dbb16d9f0146dfcddc064921a5434f19","unresolved":false,"context_lines":[{"line_number":2925,"context_line":"        \u003cnova:vcpus\u003e8\u003c/nova:vcpus\u003e"},{"line_number":2926,"context_line":"      \u003c/nova:flavor\u003e"},{"line_number":2927,"context_line":"      \u003cnova:owner\u003e"},{"line_number":2928,"context_line":"        \u003cnova:user\u003e3472c2a6-de91-4fb5-b618-42bc781ef670\u003c/nova:user\u003e"},{"line_number":2929,"context_line":"        \u003cnova:project\u003ef241e906-010e-4917-ae81-53f4fb8aa021\u003c/nova:project\u003e"},{"line_number":2930,"context_line":"      \u003c/nova:owner\u003e"},{"line_number":2931,"context_line":"      \u003cnova:root type\u003d\"image\" uuid\u003d\"fe55c69a-8b2e-4bbc-811a-9ad2023a0426\"/\u003e"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a74a57a_4dad8f87","line":2928,"updated":"2016-11-30 13:43:20.000000000","message":"So I was thinking about this again and ran into the danpb\u0027s blog post on this very feature of Nova: https://www.berrange.com/posts/2015/02/20/nova-metadata-recorded-in-libvirt-guest-instance-xml/\n\none of the paragraphs suggests that external tooling in Linux distros may rely on the data format  \n\n\"The intention is that as long as the XML namespace URI (http://openstack.org/xmlns/libvirt/nova/1.0) isn’t changed, the data reported here will not change in a backwards incompatible manner. IOW, we will add further elements or attributes to the Nova metadata, but not change or remove existing elements or attributes. So if OpenStack related troubleshooting / debugging tools want to extract this data from the libvirt XML they can be reasonably well assured of compatibility across future Nova releases.\"\n\nand we are slightly change it here - the \"uuid\" attribute is now gone.\n\nI know, it\u0027s super pedantic, but maybe we should consider bumping of the version in the namespace URI to make it clear that the format has changed?","commit_id":"66879c23c79196e3957c6b536b97fabbab2169ef"},{"author":{"_account_id":21382,"name":"Danil","email":"dakhmetov@mirantis.com","username":"dinobot"},"change_message_id":"1fa9b0e00e1a25e3fef3ec3ac903e1c4660e39a7","unresolved":false,"context_lines":[{"line_number":2925,"context_line":"        \u003cnova:vcpus\u003e8\u003c/nova:vcpus\u003e"},{"line_number":2926,"context_line":"      \u003c/nova:flavor\u003e"},{"line_number":2927,"context_line":"      \u003cnova:owner\u003e"},{"line_number":2928,"context_line":"        \u003cnova:user\u003e3472c2a6-de91-4fb5-b618-42bc781ef670\u003c/nova:user\u003e"},{"line_number":2929,"context_line":"        \u003cnova:project\u003ef241e906-010e-4917-ae81-53f4fb8aa021\u003c/nova:project\u003e"},{"line_number":2930,"context_line":"      \u003c/nova:owner\u003e"},{"line_number":2931,"context_line":"      \u003cnova:root type\u003d\"image\" uuid\u003d\"fe55c69a-8b2e-4bbc-811a-9ad2023a0426\"/\u003e"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a74a57a_291afe17","line":2928,"in_reply_to":"5a74a57a_4dad8f87","updated":"2016-11-30 15:58:15.000000000","message":"Done","commit_id":"66879c23c79196e3957c6b536b97fabbab2169ef"}],"nova/tests/unit/virt/libvirt/test_driver.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fb10652bae803d4e32b579a47cfff924d0f0bd71","unresolved":false,"context_lines":[{"line_number":1960,"context_line":""},{"line_number":1961,"context_line":"        ctxt \u003d context.RequestContext(project_id\u003d\"123\","},{"line_number":1962,"context_line":"                                      project_name\u003d\"aubergine\","},{"line_number":1963,"context_line":"                                      user_id\u003d\"456\","},{"line_number":1964,"context_line":"                                      user_name\u003d\"pie\")"},{"line_number":1965,"context_line":""},{"line_number":1966,"context_line":"        flavor \u003d objects.Flavor(name\u003d\u0027m1.small\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a74a57a_3b350446","line":1963,"updated":"2016-11-23 13:21:27.000000000","message":"Danil, unless i\u0027m mistaken, I don\u0027t believe you needed to add another whole test. You just needed to add or modify some assert statements in the test_get_guest_config() test to verify that the owner fields of the libvirt match the original owner\u0027s not the admin.","commit_id":"76e1d772179b97d41a40a483ffe7d49159286ab9"},{"author":{"_account_id":21382,"name":"Danil","email":"dakhmetov@mirantis.com","username":"dinobot"},"change_message_id":"faf823bfdbac89838adef81c8b917ef013221418","unresolved":false,"context_lines":[{"line_number":1960,"context_line":""},{"line_number":1961,"context_line":"        ctxt \u003d context.RequestContext(project_id\u003d\"123\","},{"line_number":1962,"context_line":"                                      project_name\u003d\"aubergine\","},{"line_number":1963,"context_line":"                                      user_id\u003d\"456\","},{"line_number":1964,"context_line":"                                      user_name\u003d\"pie\")"},{"line_number":1965,"context_line":""},{"line_number":1966,"context_line":"        flavor \u003d objects.Flavor(name\u003d\u0027m1.small\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a74a57a_19126657","line":1963,"in_reply_to":"5a74a57a_3b350446","updated":"2016-11-28 16:40:58.000000000","message":"Done","commit_id":"76e1d772179b97d41a40a483ffe7d49159286ab9"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"709e8be1101468173e4efa330005529d6ee53fd4","unresolved":false,"context_lines":[{"line_number":1924,"context_line":""},{"line_number":1925,"context_line":"        self.assertIsInstance(cfg.metadata[0].owner,"},{"line_number":1926,"context_line":"                              vconfig.LibvirtConfigGuestMetaNovaOwner)"},{"line_number":1927,"context_line":"        self.assertEqual(\u0027838a72b0-0d54-4827-8fd6-fb1227633ceb\u0027,"},{"line_number":1928,"context_line":"                         cfg.metadata[0].owner.userid)"},{"line_number":1929,"context_line":"        self.assertEqual(\"cupcake\","},{"line_number":1930,"context_line":"                         cfg.metadata[0].owner.username)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_ed7696a2","line":1927,"updated":"2017-03-06 09:55:46.000000000","message":"nit: why mix \u0027 and \" here?","commit_id":"ecdfc78e77ad2e4eceb34f10880f701ce990e3aa"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"f96a7b239d4ab59a6f064eeeab5449988cc4fb13","unresolved":false,"context_lines":[{"line_number":1922,"context_line":""},{"line_number":1923,"context_line":"        self.assertIsInstance(cfg.metadata[0].owner,"},{"line_number":1924,"context_line":"                              vconfig.LibvirtConfigGuestMetaNovaOwner)"},{"line_number":1925,"context_line":"        self.assertEqual(456,"},{"line_number":1926,"context_line":"                         cfg.metadata[0].owner.userid)"},{"line_number":1927,"context_line":"        self.assertEqual(\"pie\","},{"line_number":1928,"context_line":"                         cfg.metadata[0].owner.username)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_085811fa","side":"PARENT","line":1925,"updated":"2017-03-07 09:45:47.000000000","message":"So these were the values from the request context. Makes sense then.","commit_id":"215dc29bd9c70c4b83d47b47af9c178f8c66d132"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"66644257394126d5a3d891f8b0d30ca1c7aeb991","unresolved":false,"context_lines":[{"line_number":652,"context_line":"        \u0027extra_specs\u0027: {},"},{"line_number":653,"context_line":"        \u0027system_metadata\u0027: {"},{"line_number":654,"context_line":"            \u0027image_disk_format\u0027: \u0027raw\u0027,"},{"line_number":655,"context_line":"            \u0027owner_user_name\u0027: \u0027cupcake\u0027,"},{"line_number":656,"context_line":"            \u0027owner_project_name\u0027: \u0027sweetshop\u0027"},{"line_number":657,"context_line":"        },"},{"line_number":658,"context_line":"        \u0027flavor\u0027: flavor,"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_47d305d5","line":655,"updated":"2017-03-13 10:18:50.000000000","message":"I would love a test case where these are missing, to confirm it works OK.\n\nRight now, that will be the case for all operations that change the XML for all existing instances.","commit_id":"b89bd14db2801e016f586a12eee580a00e5488b9"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"fe7747ae725ca6e13728f7a8550cb54145479cdb","unresolved":false,"context_lines":[{"line_number":3656,"context_line":""},{"line_number":3657,"context_line":"        if context is not None:"},{"line_number":3658,"context_line":"            ometa \u003d vconfig.LibvirtConfigGuestMetaNovaOwner()"},{"line_number":3659,"context_line":"            if context.user_id \u003d\u003d instance.user_id and \\"},{"line_number":3660,"context_line":"              context.project_id \u003d\u003d instance.project_id:"},{"line_number":3661,"context_line":"                ometa.userid \u003d context.user_id"},{"line_number":3662,"context_line":"                ometa.username \u003d context.user_name"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a74a57a_c04eddc0","line":3659,"updated":"2016-11-23 12:59:13.000000000","message":"nit: we prefer to use parentheses for multi line expressions, e.g.\n\n  if (context.user_id \u003d\u003d instance.user_id and\n        context.project_id \u003d\u003d instance.project_id):\n      ...","commit_id":"76e1d772179b97d41a40a483ffe7d49159286ab9"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"fe7747ae725ca6e13728f7a8550cb54145479cdb","unresolved":false,"context_lines":[{"line_number":3664,"context_line":"                ometa.projectname \u003d context.project_name"},{"line_number":3665,"context_line":"            else:"},{"line_number":3666,"context_line":"                ometa.userid \u003d instance.user_id"},{"line_number":3667,"context_line":"                ometa.username \u003d None"},{"line_number":3668,"context_line":"                ometa.projectid \u003d instance.project_id"},{"line_number":3669,"context_line":"                ometa.projectname \u003d None"},{"line_number":3670,"context_line":"            meta.owner \u003d ometa"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a74a57a_00c7f512","line":3667,"updated":"2016-11-23 12:59:13.000000000","message":"Not sure if None values are usable here, but it\u0027s definitely better than wrong data. Using of a keystoneclient to resolve UUIDs into names is probably an overkill, so let\u0027s keep it this way.","commit_id":"76e1d772179b97d41a40a483ffe7d49159286ab9"},{"author":{"_account_id":21382,"name":"Danil","email":"dakhmetov@mirantis.com","username":"dinobot"},"change_message_id":"3bb204f727e4629484cb483dfb07ca66bbcaeedc","unresolved":false,"context_lines":[{"line_number":3664,"context_line":"                ometa.projectname \u003d context.project_name"},{"line_number":3665,"context_line":"            else:"},{"line_number":3666,"context_line":"                ometa.userid \u003d instance.user_id"},{"line_number":3667,"context_line":"                ometa.username \u003d None"},{"line_number":3668,"context_line":"                ometa.projectid \u003d instance.project_id"},{"line_number":3669,"context_line":"                ometa.projectname \u003d None"},{"line_number":3670,"context_line":"            meta.owner \u003d ometa"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_299c8fbf","line":3667,"in_reply_to":"1a6eadb0_264a2dc6","updated":"2017-01-27 16:11:39.000000000","message":"Matthew, thank you for the valid point!\n\nCould you clarify, what do you mean under \u0027source info\u0027? If you mean request context, the context user may not match the instance owner.\n\nIf so, should I open keystone session here each time when nova-compute update the libvirt.xml?","commit_id":"76e1d772179b97d41a40a483ffe7d49159286ab9"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"055aa3f9bb0ad475a5a5db426f65d1fe6b912479","unresolved":false,"context_lines":[{"line_number":3664,"context_line":"                ometa.projectname \u003d context.project_name"},{"line_number":3665,"context_line":"            else:"},{"line_number":3666,"context_line":"                ometa.userid \u003d instance.user_id"},{"line_number":3667,"context_line":"                ometa.username \u003d None"},{"line_number":3668,"context_line":"                ometa.projectid \u003d instance.project_id"},{"line_number":3669,"context_line":"                ometa.projectname \u003d None"},{"line_number":3670,"context_line":"            meta.owner \u003d ometa"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a461143_8413a50c","line":3667,"in_reply_to":"3a461143_299c8fbf","updated":"2017-01-27 17:50:28.000000000","message":"If we\u0027re recreating the libvirt xml of an existing instance, then either:\n\n1. We\u0027re overwriting what was there before on the current host (reboot off the top of my head).\n2. We\u0027re migrating from another host.\n\nIn either case, there\u0027s some previous xml kicking around which contains the information we want to retain, already resolved. Ideally we\u0027d just pull it out and copy it.","commit_id":"76e1d772179b97d41a40a483ffe7d49159286ab9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fb10652bae803d4e32b579a47cfff924d0f0bd71","unresolved":false,"context_lines":[{"line_number":3664,"context_line":"                ometa.projectname \u003d context.project_name"},{"line_number":3665,"context_line":"            else:"},{"line_number":3666,"context_line":"                ometa.userid \u003d instance.user_id"},{"line_number":3667,"context_line":"                ometa.username \u003d None"},{"line_number":3668,"context_line":"                ometa.projectid \u003d instance.project_id"},{"line_number":3669,"context_line":"                ometa.projectname \u003d None"},{"line_number":3670,"context_line":"            meta.owner \u003d ometa"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a74a57a_1b6848f5","line":3667,"in_reply_to":"5a74a57a_00c7f512","updated":"2016-11-23 13:21:27.000000000","message":"Why bother even storing the username at all? We could remove the conditional entirely and just include the UUIDs for the project and user, and no names at all.","commit_id":"76e1d772179b97d41a40a483ffe7d49159286ab9"},{"author":{"_account_id":21382,"name":"Danil","email":"dakhmetov@mirantis.com","username":"dinobot"},"change_message_id":"faf823bfdbac89838adef81c8b917ef013221418","unresolved":false,"context_lines":[{"line_number":3664,"context_line":"                ometa.projectname \u003d context.project_name"},{"line_number":3665,"context_line":"            else:"},{"line_number":3666,"context_line":"                ometa.userid \u003d instance.user_id"},{"line_number":3667,"context_line":"                ometa.username \u003d None"},{"line_number":3668,"context_line":"                ometa.projectid \u003d instance.project_id"},{"line_number":3669,"context_line":"                ometa.projectname \u003d None"},{"line_number":3670,"context_line":"            meta.owner \u003d ometa"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a74a57a_761b6981","line":3667,"in_reply_to":"5a74a57a_1b6848f5","updated":"2016-11-28 16:40:58.000000000","message":"Simplify this behaviour is really a good idea. Please see the new patch set.","commit_id":"76e1d772179b97d41a40a483ffe7d49159286ab9"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"4c59a1b6871a60e8231aaac27acd7038933c4247","unresolved":false,"context_lines":[{"line_number":3664,"context_line":"                ometa.projectname \u003d context.project_name"},{"line_number":3665,"context_line":"            else:"},{"line_number":3666,"context_line":"                ometa.userid \u003d instance.user_id"},{"line_number":3667,"context_line":"                ometa.username \u003d None"},{"line_number":3668,"context_line":"                ometa.projectid \u003d instance.project_id"},{"line_number":3669,"context_line":"                ometa.projectname \u003d None"},{"line_number":3670,"context_line":"            meta.owner \u003d ometa"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a6eadb0_264a2dc6","line":3667,"in_reply_to":"5a74a57a_761b6981","updated":"2016-12-13 16:20:37.000000000","message":"Having read the context, I don\u0027t think it\u0027s overkill to resolve these usernames. The problem is that the published namespace describes a contract which is broken by removing the text node (the username). We need to keep it, or bump the xmlns. While bumping the xmlns will, strictly speaking, define a new contract, it will still break any tools which parse this data. I\u0027d vote to keep it.\n\nNote that this information is already without expensive external lookups in the source info. If there were any way to pass it unmodified that would be better than this. Also note that this wouldn\u0027t be an issue if we didn\u0027t rewrite libvirt xml during migrations.","commit_id":"76e1d772179b97d41a40a483ffe7d49159286ab9"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"f96a7b239d4ab59a6f064eeeab5449988cc4fb13","unresolved":false,"context_lines":[{"line_number":3654,"context_line":"            meta.roottype \u003d \"image\""},{"line_number":3655,"context_line":"            meta.rootid \u003d instance.image_ref"},{"line_number":3656,"context_line":""},{"line_number":3657,"context_line":"        if instance is not None:"},{"line_number":3658,"context_line":"            system_meta \u003d instance.system_metadata"},{"line_number":3659,"context_line":"            ometa \u003d vconfig.LibvirtConfigGuestMetaNovaOwner()"},{"line_number":3660,"context_line":"            ometa.userid \u003d instance.user_id"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_e8d73d21","line":3657,"updated":"2017-03-07 09:45:47.000000000","message":"oops, I missed this in previous review, sorry :(\n\nThis check is redundant as instance can\u0027t be None - otherwise the code would fail earlier at #3650","commit_id":"714eb80ac3db84c1353e9d23a52b138a34ec08df"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0e011e5b4dcde1196d480de60ec62c32226cb0e6","unresolved":false,"context_lines":[{"line_number":3656,"context_line":""},{"line_number":3657,"context_line":"        system_meta \u003d instance.system_metadata"},{"line_number":3658,"context_line":"        ometa \u003d vconfig.LibvirtConfigGuestMetaNovaOwner()"},{"line_number":3659,"context_line":"        ometa.userid \u003d instance.user_id"},{"line_number":3660,"context_line":"        ometa.username \u003d system_meta.get(\u0027owner_user_name\u0027)"},{"line_number":3661,"context_line":"        ometa.projectid \u003d instance.project_id"},{"line_number":3662,"context_line":"        ometa.projectname \u003d system_meta.get(\u0027owner_project_name\u0027)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_e4331712","line":3659,"range":{"start_line":3659,"start_character":8,"end_line":3659,"end_character":39},"updated":"2017-03-13 09:58:09.000000000","message":"This I love, we should have done that from the beginning.","commit_id":"b89bd14db2801e016f586a12eee580a00e5488b9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f6424c4e21a980aacb4c013fed263443346dff2a","unresolved":false,"context_lines":[{"line_number":3657,"context_line":"        system_meta \u003d instance.system_metadata"},{"line_number":3658,"context_line":"        ometa \u003d vconfig.LibvirtConfigGuestMetaNovaOwner()"},{"line_number":3659,"context_line":"        ometa.userid \u003d instance.user_id"},{"line_number":3660,"context_line":"        ometa.username \u003d system_meta.get(\u0027owner_user_name\u0027)"},{"line_number":3661,"context_line":"        ometa.projectid \u003d instance.project_id"},{"line_number":3662,"context_line":"        ometa.projectname \u003d system_meta.get(\u0027owner_project_name\u0027)"},{"line_number":3663,"context_line":"        meta.owner \u003d ometa"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_7114fff4","line":3660,"updated":"2017-03-07 17:42:54.000000000","message":"So, the above would set userid to the user UUID that owns the instance but would set the username potentially to \"admin\" if the admin is the one operating on the instance (because system_meta[\u0027owner_user_name\u0027] is set from context.user_name. Same goes for the project_id vs. project_name.\n\nIs that intended?\n\nI\u0027d almost prefer to only store the instance.project_id and instance.user_id and not store the names at all, since those names correspond to the user issuing the request not the owner.","commit_id":"b89bd14db2801e016f586a12eee580a00e5488b9"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"d915cd7249742bd0964a53db6781778580171c0a","unresolved":false,"context_lines":[{"line_number":3657,"context_line":"        system_meta \u003d instance.system_metadata"},{"line_number":3658,"context_line":"        ometa \u003d vconfig.LibvirtConfigGuestMetaNovaOwner()"},{"line_number":3659,"context_line":"        ometa.userid \u003d instance.user_id"},{"line_number":3660,"context_line":"        ometa.username \u003d system_meta.get(\u0027owner_user_name\u0027)"},{"line_number":3661,"context_line":"        ometa.projectid \u003d instance.project_id"},{"line_number":3662,"context_line":"        ometa.projectname \u003d system_meta.get(\u0027owner_project_name\u0027)"},{"line_number":3663,"context_line":"        meta.owner \u003d ometa"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_e6562029","line":3660,"in_reply_to":"9a30ddce_7114fff4","updated":"2017-03-09 14:16:32.000000000","message":"Hmm, but I thought _populate_instance_for_create() (where we set the metadata properties) could only be called during initial creation of an instance. Can an admin user create a VM on behalf of someone else?","commit_id":"b89bd14db2801e016f586a12eee580a00e5488b9"},{"author":{"_account_id":21382,"name":"Danil","email":"dakhmetov@mirantis.com","username":"dinobot"},"change_message_id":"b3fd7d2d8af35a09e74ddc2017e26cb9514d4134","unresolved":false,"context_lines":[{"line_number":3657,"context_line":"        system_meta \u003d instance.system_metadata"},{"line_number":3658,"context_line":"        ometa \u003d vconfig.LibvirtConfigGuestMetaNovaOwner()"},{"line_number":3659,"context_line":"        ometa.userid \u003d instance.user_id"},{"line_number":3660,"context_line":"        ometa.username \u003d system_meta.get(\u0027owner_user_name\u0027)"},{"line_number":3661,"context_line":"        ometa.projectid \u003d instance.project_id"},{"line_number":3662,"context_line":"        ometa.projectname \u003d system_meta.get(\u0027owner_project_name\u0027)"},{"line_number":3663,"context_line":"        meta.owner \u003d ometa"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_ac7ec716","line":3660,"in_reply_to":"9a30ddce_d11f1406","updated":"2017-03-09 14:48:21.000000000","message":"I recently checked: yes,  _populate_instance_for_create() is called only (!) on instance creation, so ownership info stored in system meta can\u0027t be re-written even if admin migrates/evacuates/unshelves/etc. the instance. Anyway thank you for the note :)","commit_id":"b89bd14db2801e016f586a12eee580a00e5488b9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9345a87c02cb36d3c5d93b1278172c67ba5df034","unresolved":false,"context_lines":[{"line_number":3657,"context_line":"        system_meta \u003d instance.system_metadata"},{"line_number":3658,"context_line":"        ometa \u003d vconfig.LibvirtConfigGuestMetaNovaOwner()"},{"line_number":3659,"context_line":"        ometa.userid \u003d instance.user_id"},{"line_number":3660,"context_line":"        ometa.username \u003d system_meta.get(\u0027owner_user_name\u0027)"},{"line_number":3661,"context_line":"        ometa.projectid \u003d instance.project_id"},{"line_number":3662,"context_line":"        ometa.projectname \u003d system_meta.get(\u0027owner_project_name\u0027)"},{"line_number":3663,"context_line":"        meta.owner \u003d ometa"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_d11f1406","line":3660,"in_reply_to":"9a30ddce_e6562029","updated":"2017-03-09 14:25:15.000000000","message":"Yeah, after chatting with Danil offline, I asked him to go and ensure that _populate_instance_for_create() was *only* ever called for create and never for reboot, unshelve, migrate, etc.\n\nIf it is, then I\u0027m OK to let this through.","commit_id":"b89bd14db2801e016f586a12eee580a00e5488b9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0e011e5b4dcde1196d480de60ec62c32226cb0e6","unresolved":false,"context_lines":[{"line_number":3658,"context_line":"        ometa \u003d vconfig.LibvirtConfigGuestMetaNovaOwner()"},{"line_number":3659,"context_line":"        ometa.userid \u003d instance.user_id"},{"line_number":3660,"context_line":"        ometa.username \u003d system_meta.get(\u0027owner_user_name\u0027)"},{"line_number":3661,"context_line":"        ometa.projectid \u003d instance.project_id"},{"line_number":3662,"context_line":"        ometa.projectname \u003d system_meta.get(\u0027owner_project_name\u0027)"},{"line_number":3663,"context_line":"        meta.owner \u003d ometa"},{"line_number":3664,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_443dc3db","line":3661,"range":{"start_line":3661,"start_character":8,"end_line":3661,"end_character":45},"updated":"2017-03-13 09:58:09.000000000","message":"This I also love.","commit_id":"b89bd14db2801e016f586a12eee580a00e5488b9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0e011e5b4dcde1196d480de60ec62c32226cb0e6","unresolved":false,"context_lines":[{"line_number":3659,"context_line":"        ometa.userid \u003d instance.user_id"},{"line_number":3660,"context_line":"        ometa.username \u003d system_meta.get(\u0027owner_user_name\u0027)"},{"line_number":3661,"context_line":"        ometa.projectid \u003d instance.project_id"},{"line_number":3662,"context_line":"        ometa.projectname \u003d system_meta.get(\u0027owner_project_name\u0027)"},{"line_number":3663,"context_line":"        meta.owner \u003d ometa"},{"line_number":3664,"context_line":""},{"line_number":3665,"context_line":"        fmeta \u003d vconfig.LibvirtConfigGuestMetaNovaFlavor()"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_640f2737","line":3662,"range":{"start_line":3662,"start_character":8,"end_line":3662,"end_character":25},"updated":"2017-03-13 09:58:09.000000000","message":"The projectname and username are not \"static\" things, so the best we can ever do here is insert what the name was when the instance was booted.\n\nMaybe we should just not fill this in, and just have the things that are static listed here?\n\nAll of that is better than the current situation where the info can be totally wrong.","commit_id":"b89bd14db2801e016f586a12eee580a00e5488b9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"50c3216a9beaee1d19a00a0e8db15fa07d3184df","unresolved":false,"context_lines":[{"line_number":3659,"context_line":"        ometa.userid \u003d instance.user_id"},{"line_number":3660,"context_line":"        ometa.username \u003d system_meta.get(\u0027owner_user_name\u0027)"},{"line_number":3661,"context_line":"        ometa.projectid \u003d instance.project_id"},{"line_number":3662,"context_line":"        ometa.projectname \u003d system_meta.get(\u0027owner_project_name\u0027)"},{"line_number":3663,"context_line":"        meta.owner \u003d ometa"},{"line_number":3664,"context_line":""},{"line_number":3665,"context_line":"        fmeta \u003d vconfig.LibvirtConfigGuestMetaNovaFlavor()"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_e784f95e","line":3662,"range":{"start_line":3662,"start_character":8,"end_line":3662,"end_character":25},"in_reply_to":"9a30ddce_640f2737","updated":"2017-03-13 10:01:11.000000000","message":"I am also a bit curious what happens when projectname \u003d None, I guess its just an empty XML tag, which should be OK I presume? Has that been tested somehow?","commit_id":"b89bd14db2801e016f586a12eee580a00e5488b9"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"cbabc999cf2b2bd3e7055674cc79b329adb0ac8a","unresolved":false,"context_lines":[{"line_number":3657,"context_line":"        system_meta \u003d instance.system_metadata"},{"line_number":3658,"context_line":"        ometa \u003d vconfig.LibvirtConfigGuestMetaNovaOwner()"},{"line_number":3659,"context_line":"        ometa.userid \u003d instance.user_id"},{"line_number":3660,"context_line":"        ometa.username \u003d system_meta.get(\u0027owner_user_name\u0027, \u0027N/A\u0027)"},{"line_number":3661,"context_line":"        ometa.projectid \u003d instance.project_id"},{"line_number":3662,"context_line":"        ometa.projectname \u003d system_meta.get(\u0027owner_project_name\u0027, \u0027N/A\u0027)"},{"line_number":3663,"context_line":"        meta.owner \u003d ometa"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a1ff146_8ee41c3c","line":3660,"range":{"start_line":3660,"start_character":60,"end_line":3660,"end_character":65},"updated":"2017-03-14 16:49:56.000000000","message":"I guess this is as good as any arbitrary value for: sorry, we lost it.","commit_id":"3f2935872da311f79b5fd4d51fb50b4fcf8d2bcd"}]}
