)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"b4db939e01dea89276d6364883a6f9d66516a9f9","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"There are a number of patches that make use of the flavors to access"},{"line_number":10,"context_line":"various data regarding certain guest properties. This refactor will"},{"line_number":11,"context_line":"populate a diction called \u0027extra_specs\u0027 that will be used by the"},{"line_number":12,"context_line":"get_vm_create_spec method. The extra_specs will include the"},{"line_number":13,"context_line":"allocations and all additional information, for example, hardware"},{"line_number":14,"context_line":"version etc."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"baa201ad_695c027e","line":11,"updated":"2014-10-17 06:21:19.000000000","message":"s/diction/dictionary/","commit_id":"f5a2b13c7364ff58f7df9ebdadf43cd73d54b014"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b4f18e5c534d7cba78dcb4fbec8ee19fdc5e9622","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"There are a number of patches that make use of the flavors to access"},{"line_number":10,"context_line":"various data regarding certain guest properties. This refactor will"},{"line_number":11,"context_line":"populate a diction called \u0027extra_specs\u0027 that will be used by the"},{"line_number":12,"context_line":"get_vm_create_spec method. The extra_specs will include the"},{"line_number":13,"context_line":"allocations and all additional information, for example, hardware"},{"line_number":14,"context_line":"version etc."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"baa201ad_24505f31","line":11,"in_reply_to":"baa201ad_695c027e","updated":"2014-10-17 07:29:00.000000000","message":"Done","commit_id":"f5a2b13c7364ff58f7df9ebdadf43cd73d54b014"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"cfda8a33092d677f33c155ba3d8edea5b985fb89","unresolved":false,"context_lines":[{"line_number":10,"context_line":"various data regarding certain guest properties. This refactor will"},{"line_number":11,"context_line":"populate a dictionary called \u0027extra_specs\u0027 that will be used by the"},{"line_number":12,"context_line":"get_vm_create_spec method. The extra_specs will include the"},{"line_number":13,"context_line":"allocations and all additional information, for example, hardware"},{"line_number":14,"context_line":"version etc."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: Id54d5f40eb61b2ff7c0e761b6bfdc6fa67de5ca3"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9aa7fdbe_feb4ed36","line":13,"updated":"2014-10-29 03:54:51.000000000","message":"Creating loosely structured dict instead of using explicit parameters sounds like a step in the wrong direction. I would think this would make the code harder to read.","commit_id":"713da3cae2d37574ea537808d7374431a6875fdf"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"c08955f0d037e2a3fa74cb3aec900bfce1375056","unresolved":false,"context_lines":[{"line_number":10,"context_line":"various data regarding certain guest properties. This refactor will"},{"line_number":11,"context_line":"populate a dictionary called \u0027extra_specs\u0027 that will be used by the"},{"line_number":12,"context_line":"get_vm_create_spec method. The extra_specs will include the"},{"line_number":13,"context_line":"allocations and all additional information, for example, hardware"},{"line_number":14,"context_line":"version etc."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: Id54d5f40eb61b2ff7c0e761b6bfdc6fa67de5ca3"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9aa7fdbe_1dee0eb5","line":13,"in_reply_to":"9aa7fdbe_feb4ed36","updated":"2014-10-29 12:34:53.000000000","message":"I think the idea is to filter and parse the extra specs from the flavor which are relevant to the VMware driver, so they can be used when spawning instances. These are all optional \"hints\" for the driver, so grouping them in a dict looks reasonable to me.","commit_id":"713da3cae2d37574ea537808d7374431a6875fdf"}],"nova/virt/vmwareapi/vm_util.py":[{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"b4db939e01dea89276d6364883a6f9d66516a9f9","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"def get_vm_create_spec(client_factory, instance, name, data_store_name,"},{"line_number":102,"context_line":"                       vif_infos, os_type\u003dconstants.DEFAULT_OS_TYPE,"},{"line_number":103,"context_line":"                       extra_specs\u003dNone):"},{"line_number":104,"context_line":"    \"\"\"Builds the VM Create spec.\"\"\""},{"line_number":105,"context_line":"    config_spec \u003d client_factory.create(\u0027ns0:VirtualMachineConfigSpec\u0027)"},{"line_number":106,"context_line":"    config_spec.name \u003d name"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_0992964b","line":103,"updated":"2014-10-17 06:21:19.000000000","message":"remove the default value None","commit_id":"f5a2b13c7364ff58f7df9ebdadf43cd73d54b014"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b4f18e5c534d7cba78dcb4fbec8ee19fdc5e9622","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"def get_vm_create_spec(client_factory, instance, name, data_store_name,"},{"line_number":102,"context_line":"                       vif_infos, os_type\u003dconstants.DEFAULT_OS_TYPE,"},{"line_number":103,"context_line":"                       extra_specs\u003dNone):"},{"line_number":104,"context_line":"    \"\"\"Builds the VM Create spec.\"\"\""},{"line_number":105,"context_line":"    config_spec \u003d client_factory.create(\u0027ns0:VirtualMachineConfigSpec\u0027)"},{"line_number":106,"context_line":"    config_spec.name \u003d name"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_4443a36b","line":103,"in_reply_to":"baa201ad_0992964b","updated":"2014-10-17 07:29:00.000000000","message":"Done","commit_id":"f5a2b13c7364ff58f7df9ebdadf43cd73d54b014"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"b4db939e01dea89276d6364883a6f9d66516a9f9","unresolved":false,"context_lines":[{"line_number":130,"context_line":"    config_spec.memoryMB \u003d int(instance[\u0027memory_mb\u0027])"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    # Configure cpu information"},{"line_number":133,"context_line":"    allocations \u003d {} if extra_specs is None else extra_specs[\u0027allocations\u0027]"},{"line_number":134,"context_line":"    if (allocations is not None and"},{"line_number":135,"context_line":"        (\u0027cpu_limit\u0027 in allocations or"},{"line_number":136,"context_line":"         \u0027cpu_reservation\u0027 in allocations or"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_c9ab2e73","line":133,"updated":"2014-10-17 06:21:19.000000000","message":"you can avoid this clumsy syntax and assume that extra_spec is always a dictionary; if there are no extra specs, then it will be an empty dictionary; then you can simply do:\n\n    allocations \u003d extra_specs.get(\u0027allocations\u0027)\n    hw_version \u003d extra_specs.get(\u0027hw_version\u0027)\n\nit is always better to return an empty collection instead of None which is exactly the case with _get_extra_specs in vmops.py","commit_id":"f5a2b13c7364ff58f7df9ebdadf43cd73d54b014"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"cd875df9ee3329f924a009f6b3efcb6cbc950c2b","unresolved":false,"context_lines":[{"line_number":130,"context_line":"    config_spec.memoryMB \u003d int(instance[\u0027memory_mb\u0027])"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    # Configure cpu information"},{"line_number":133,"context_line":"    allocations \u003d extra_specs[\u0027allocations\u0027]"},{"line_number":134,"context_line":"    if (allocations is not None and"},{"line_number":135,"context_line":"        (\u0027cpu_limit\u0027 in allocations or"},{"line_number":136,"context_line":"         \u0027cpu_reservation\u0027 in allocations or"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa7fdbe_c17104e2","line":133,"updated":"2014-10-29 13:15:10.000000000","message":"I think that _get_extra_specs is a good way to go in the context of what follows in this series. I think an unstructured dict is fine in that context. However, at this point we\u0027re now assuming the contents of a dict defined in another module, which is certainly harder to read.\n\nMy preference would be for _get_extra_specs to marshall its dict the same way it does now, but for _build_virtual_machine to pass named values to get_vm_create_spec() because it crosses a module boundary.\n\nI don\u0027t feel strongly enough about it for a -1, though.","commit_id":"713da3cae2d37574ea537808d7374431a6875fdf"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"8b6e671c5f1234c57b1af7778fbc38be8a2083cd","unresolved":false,"context_lines":[{"line_number":151,"context_line":"    config_spec.memoryMB \u003d int(instance[\u0027memory_mb\u0027])"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    # Configure cpu information"},{"line_number":154,"context_line":"    if (extra_specs.cpu_limits.cpu_limit is not None or"},{"line_number":155,"context_line":"        extra_specs.cpu_limits.cpu_reservation is not None or"},{"line_number":156,"context_line":"        extra_specs.cpu_limits.cpu_shares_level is not None):"},{"line_number":157,"context_line":"        allocation \u003d client_factory.create(\u0027ns0:ResourceAllocationInfo\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_fb1cf115","line":154,"updated":"2014-11-10 10:43:07.000000000","message":"you factor out these checks in a helper method in ExtraSpecs which returns if we have cpu_limits or not; that will make the code easier to read","commit_id":"6d2b1f8b0bc9fd84908b3b85ed8133b0e6b9dab9"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d03c0fb687a7bf18b20fed7742dd25d004d2806a","unresolved":false,"context_lines":[{"line_number":151,"context_line":"    config_spec.memoryMB \u003d int(instance[\u0027memory_mb\u0027])"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    # Configure cpu information"},{"line_number":154,"context_line":"    if (extra_specs.cpu_limits.cpu_limit is not None or"},{"line_number":155,"context_line":"        extra_specs.cpu_limits.cpu_reservation is not None or"},{"line_number":156,"context_line":"        extra_specs.cpu_limits.cpu_shares_level is not None):"},{"line_number":157,"context_line":"        allocation \u003d client_factory.create(\u0027ns0:ResourceAllocationInfo\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_dbdad5e8","line":154,"in_reply_to":"5a890539_fb1cf115","updated":"2014-11-10 11:52:45.000000000","message":"Done","commit_id":"6d2b1f8b0bc9fd84908b3b85ed8133b0e6b9dab9"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"8b6e671c5f1234c57b1af7778fbc38be8a2083cd","unresolved":false,"context_lines":[{"line_number":155,"context_line":"        extra_specs.cpu_limits.cpu_reservation is not None or"},{"line_number":156,"context_line":"        extra_specs.cpu_limits.cpu_shares_level is not None):"},{"line_number":157,"context_line":"        allocation \u003d client_factory.create(\u0027ns0:ResourceAllocationInfo\u0027)"},{"line_number":158,"context_line":"        if extra_specs.cpu_limits.cpu_limit is not None:"},{"line_number":159,"context_line":"            allocation.limit \u003d extra_specs.cpu_limits.cpu_limit"},{"line_number":160,"context_line":"        if extra_specs.cpu_limits.cpu_reservation is not None:"},{"line_number":161,"context_line":"            allocation.reservation \u003d extra_specs.cpu_limits.cpu_reservation"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_9b176e51","line":158,"updated":"2014-11-10 10:43:07.000000000","message":"I don\u0027t think we need these checks for None. When you create ResourceAllocationInfo, all of its properties are initialized to None and re-assigning them to None doesn\u0027t hurt.","commit_id":"6d2b1f8b0bc9fd84908b3b85ed8133b0e6b9dab9"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d03c0fb687a7bf18b20fed7742dd25d004d2806a","unresolved":false,"context_lines":[{"line_number":155,"context_line":"        extra_specs.cpu_limits.cpu_reservation is not None or"},{"line_number":156,"context_line":"        extra_specs.cpu_limits.cpu_shares_level is not None):"},{"line_number":157,"context_line":"        allocation \u003d client_factory.create(\u0027ns0:ResourceAllocationInfo\u0027)"},{"line_number":158,"context_line":"        if extra_specs.cpu_limits.cpu_limit is not None:"},{"line_number":159,"context_line":"            allocation.limit \u003d extra_specs.cpu_limits.cpu_limit"},{"line_number":160,"context_line":"        if extra_specs.cpu_limits.cpu_reservation is not None:"},{"line_number":161,"context_line":"            allocation.reservation \u003d extra_specs.cpu_limits.cpu_reservation"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_db01f53a","line":158,"in_reply_to":"5a890539_9b176e51","updated":"2014-11-10 11:52:45.000000000","message":"Done","commit_id":"6d2b1f8b0bc9fd84908b3b85ed8133b0e6b9dab9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c05b74798939545ac35c020c5386a17dc098af7d","unresolved":false,"context_lines":[{"line_number":156,"context_line":"    config_spec.memoryMB \u003d int(instance[\u0027memory_mb\u0027])"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    # Configure cpu information"},{"line_number":159,"context_line":"    if (extra_specs.has_cpu_limits()):"},{"line_number":160,"context_line":"        allocation \u003d client_factory.create(\u0027ns0:ResourceAllocationInfo\u0027)"},{"line_number":161,"context_line":"        if extra_specs.cpu_limits.cpu_limit:"},{"line_number":162,"context_line":"            allocation.limit \u003d extra_specs.cpu_limits.cpu_limit"}],"source_content_type":"text/x-python","patch_set":13,"id":"5a890539_79159b9a","line":159,"updated":"2014-11-17 22:24:30.000000000","message":"outer parens not needed above.","commit_id":"f0ef92ea07cac53cbed090423eae081ff66528b1"}],"nova/virt/vmwareapi/vmops.py":[{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"cfda8a33092d677f33c155ba3d8edea5b985fb89","unresolved":false,"context_lines":[{"line_number":260,"context_line":"                            (\u0027cpu_reservation\u0027, int),"},{"line_number":261,"context_line":"                            (\u0027cpu_shares_level\u0027, str),"},{"line_number":262,"context_line":"                            (\u0027cpu_shares_share\u0027, int)):"},{"line_number":263,"context_line":"            value \u003d flavor.extra_specs.get(\u0027quota:\u0027 + key)"},{"line_number":264,"context_line":"            if value:"},{"line_number":265,"context_line":"                allocations[key] \u003d type(value)"},{"line_number":266,"context_line":"        extra_specs \u003d {\u0027allocations\u0027: allocations}"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa7fdbe_7ea9ddde","line":263,"updated":"2014-10-29 03:54:51.000000000","message":"having flavor.extra_specs and then a slightly different dict called extra_specs here just sounds confusing.","commit_id":"713da3cae2d37574ea537808d7374431a6875fdf"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"c08955f0d037e2a3fa74cb3aec900bfce1375056","unresolved":false,"context_lines":[{"line_number":260,"context_line":"                            (\u0027cpu_reservation\u0027, int),"},{"line_number":261,"context_line":"                            (\u0027cpu_shares_level\u0027, str),"},{"line_number":262,"context_line":"                            (\u0027cpu_shares_share\u0027, int)):"},{"line_number":263,"context_line":"            value \u003d flavor.extra_specs.get(\u0027quota:\u0027 + key)"},{"line_number":264,"context_line":"            if value:"},{"line_number":265,"context_line":"                allocations[key] \u003d type(value)"},{"line_number":266,"context_line":"        extra_specs \u003d {\u0027allocations\u0027: allocations}"}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa7fdbe_bd6b421e","line":263,"in_reply_to":"9aa7fdbe_7ea9ddde","updated":"2014-10-29 12:34:53.000000000","message":"we just filter the properties which are relevant to the VMware driver and make them easier to use","commit_id":"713da3cae2d37574ea537808d7374431a6875fdf"}]}
