)]}'
{"nova/objects/image_meta.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"fbb3f383698616265449c6f1bc42aab56181b2d4","unresolved":false,"context_lines":[{"line_number":360,"context_line":"            self.hw_numa_mem \u003d hw_numa_mem"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"    def _set_dict_numa_mem(self, props_dict):"},{"line_number":363,"context_line":"        if self.get(\u0027hw_numa_mem\u0027) is None:"},{"line_number":364,"context_line":"            return"},{"line_number":365,"context_line":"        nodes \u003d self.get(\u0027hw_numa_nodes\u0027, 1)"},{"line_number":366,"context_line":"        for cellid in range(nodes):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_4809032c","line":363,"updated":"2015-06-05 13:56:21.000000000","message":"Use self.obj_attr_is_set(\"hw_numa_mem\")  here","commit_id":"edcd739de7416941c61adbff7e55aa295b01538c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3a9e5e3f0887e28abaa6c2f0545dcf4fb55a06d3","unresolved":false,"context_lines":[{"line_number":360,"context_line":"            self.hw_numa_mem \u003d hw_numa_mem"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"    def _set_dict_numa_mem(self, props_dict):"},{"line_number":363,"context_line":"        if self.get(\u0027hw_numa_mem\u0027) is None:"},{"line_number":364,"context_line":"            return"},{"line_number":365,"context_line":"        nodes \u003d self.get(\u0027hw_numa_nodes\u0027, 1)"},{"line_number":366,"context_line":"        for cellid in range(nodes):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_28aa47d5","line":363,"in_reply_to":"3afb71cf_4809032c","updated":"2015-06-05 14:01:03.000000000","message":"Ack","commit_id":"edcd739de7416941c61adbff7e55aa295b01538c"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"fbb3f383698616265449c6f1bc42aab56181b2d4","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        if self.get(\u0027hw_numa_mem\u0027) is None:"},{"line_number":364,"context_line":"            return"},{"line_number":365,"context_line":"        nodes \u003d self.get(\u0027hw_numa_nodes\u0027, 1)"},{"line_number":366,"context_line":"        for cellid in range(nodes):"},{"line_number":367,"context_line":"            try:"},{"line_number":368,"context_line":"                cell \u003d self.hw_numa_mem[cellid]"},{"line_number":369,"context_line":"            except IndexError:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_88fffb00","line":366,"updated":"2015-06-05 13:56:21.000000000","message":"This logic is wrong - you can\u0027t rely on hw_numa_nodes being set.\n\nJust use\n\n  for cellid in range(len(self.hw_numa_mem)):","commit_id":"edcd739de7416941c61adbff7e55aa295b01538c"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"900dd9ed07e128a01d18dab40121a5ef6f8b969b","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        if self.get(\u0027hw_numa_mem\u0027) is None:"},{"line_number":364,"context_line":"            return"},{"line_number":365,"context_line":"        nodes \u003d self.get(\u0027hw_numa_nodes\u0027, 1)"},{"line_number":366,"context_line":"        for cellid in range(nodes):"},{"line_number":367,"context_line":"            try:"},{"line_number":368,"context_line":"                cell \u003d self.hw_numa_mem[cellid]"},{"line_number":369,"context_line":"            except IndexError:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_e8a0af92","line":366,"in_reply_to":"3afb71cf_68d5df41","updated":"2015-06-05 14:06:30.000000000","message":"Yep, that method is broken too. https://review.openstack.org/#/c/188788/","commit_id":"edcd739de7416941c61adbff7e55aa295b01538c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3a9e5e3f0887e28abaa6c2f0545dcf4fb55a06d3","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        if self.get(\u0027hw_numa_mem\u0027) is None:"},{"line_number":364,"context_line":"            return"},{"line_number":365,"context_line":"        nodes \u003d self.get(\u0027hw_numa_nodes\u0027, 1)"},{"line_number":366,"context_line":"        for cellid in range(nodes):"},{"line_number":367,"context_line":"            try:"},{"line_number":368,"context_line":"                cell \u003d self.hw_numa_mem[cellid]"},{"line_number":369,"context_line":"            except IndexError:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_68d5df41","line":366,"in_reply_to":"3afb71cf_88fffb00","updated":"2015-06-05 14:01:03.000000000","message":"I was following the same pattern as in _set_numa_mem() by considering that whatever the number of cells being set, it was said by hw_numa_nodes (ie. a wrong number couldn\u0027t happen)\n\nThat said, I\u0027m fine with your comment, will put it.","commit_id":"edcd739de7416941c61adbff7e55aa295b01538c"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"fbb3f383698616265449c6f1bc42aab56181b2d4","unresolved":false,"context_lines":[{"line_number":396,"context_line":"            except IndexError:"},{"line_number":397,"context_line":"                continue"},{"line_number":398,"context_line":"            props_dict[\"hw_numa_cpus.%d\" % cellid"},{"line_number":399,"context_line":"                       ] \u003d hardware.format_cpu_spec(cell)"},{"line_number":400,"context_line":""},{"line_number":401,"context_line":"    def _set_attr_from_current_names(self, image_props):"},{"line_number":402,"context_line":"        for key in self.fields:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_08142b42","line":399,"updated":"2015-06-05 13:56:21.000000000","message":"Same two points as previous method","commit_id":"edcd739de7416941c61adbff7e55aa295b01538c"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"85097ae131f7d1d0257017f06b52ad6b70cd2944","unresolved":false,"context_lines":[{"line_number":462,"context_line":"    def to_dict(self):"},{"line_number":463,"context_line":"        \"\"\"Returns image props dictionary from the current object.\"\"\""},{"line_number":464,"context_line":"        props \u003d {}"},{"line_number":465,"context_line":"        self._set_dict_from_legacy_names(props)"},{"line_number":466,"context_line":"        self._set_dict_from_current_names(props)"},{"line_number":467,"context_line":"        return props"},{"line_number":468,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_c30cab96","line":465,"updated":"2015-06-16 09:03:02.000000000","message":"Hmm, can you explain why you want/need to preserve the legacy names ? When finish switching the virt drivers over to use this object, nothing in Nova should be using the legacy names anymore. They\u0027d only exist for purposes of backwards compat with existing images where users had used the legacy names. In a couple of releases we\u0027d delete even this back compat code. So I think the to_dict()  method should exclusively use the new names.","commit_id":"2208f0286ded782866a133fae14ed006542ee5ed"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"6a7d1ffa2beaab66ce03885c7a3f6b9932613a1e","unresolved":false,"context_lines":[{"line_number":462,"context_line":"    def to_dict(self):"},{"line_number":463,"context_line":"        \"\"\"Returns image props dictionary from the current object.\"\"\""},{"line_number":464,"context_line":"        props \u003d {}"},{"line_number":465,"context_line":"        self._set_dict_from_legacy_names(props)"},{"line_number":466,"context_line":"        self._set_dict_from_current_names(props)"},{"line_number":467,"context_line":"        return props"},{"line_number":468,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_d9157e49","line":465,"in_reply_to":"fa32b979_59d72eed","updated":"2015-06-16 09:47:41.000000000","message":"Well the from_dict/to_dict methods will still be idempotent once the legacy keys have been converted to new names. By using legacy names you\u0027ll actually make it non-idempotent for an imeges that are already using the new names. Once nova is fully converted to use ImageMeta object, I don\u0027t think the schedular would ever see legacy names at all. So I still don\u0027t see a good reason to use legacy names in to_dict.","commit_id":"2208f0286ded782866a133fae14ed006542ee5ed"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"309bdef6aeb0c86ae3e1abb25ec388003c9f78ef","unresolved":false,"context_lines":[{"line_number":462,"context_line":"    def to_dict(self):"},{"line_number":463,"context_line":"        \"\"\"Returns image props dictionary from the current object.\"\"\""},{"line_number":464,"context_line":"        props \u003d {}"},{"line_number":465,"context_line":"        self._set_dict_from_legacy_names(props)"},{"line_number":466,"context_line":"        self._set_dict_from_current_names(props)"},{"line_number":467,"context_line":"        return props"},{"line_number":468,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_59d72eed","line":465,"in_reply_to":"fa32b979_c30cab96","updated":"2015-06-16 09:41:21.000000000","message":"I just want to make sure that the Image dict/undict is idempotent since I need to create a RequestSpec object in a module and then put it back to filter_props and req_spec before calling the sounthbound methods (in order to have very small changes)","commit_id":"2208f0286ded782866a133fae14ed006542ee5ed"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4f9b7649a954fd348d3503391170094c58bb96d6","unresolved":false,"context_lines":[{"line_number":462,"context_line":"    def to_dict(self):"},{"line_number":463,"context_line":"        \"\"\"Returns image props dictionary from the current object.\"\"\""},{"line_number":464,"context_line":"        props \u003d {}"},{"line_number":465,"context_line":"        self._set_dict_from_legacy_names(props)"},{"line_number":466,"context_line":"        self._set_dict_from_current_names(props)"},{"line_number":467,"context_line":"        return props"},{"line_number":468,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_f88859c7","line":465,"in_reply_to":"fa32b979_d9157e49","updated":"2015-06-16 21:49:05.000000000","message":"Fair point, will remove that then","commit_id":"2208f0286ded782866a133fae14ed006542ee5ed"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"302e119ecb9486dd3eda8c915181b5fc6e8c2710","unresolved":false,"context_lines":[{"line_number":448,"context_line":"        obj._set_attr_from_current_names(image_props)"},{"line_number":449,"context_line":"        return obj"},{"line_number":450,"context_line":""},{"line_number":451,"context_line":"    def to_dict(self):"},{"line_number":452,"context_line":"        \"\"\"Returns image props dictionary from the current object.\"\"\""},{"line_number":453,"context_line":"        props \u003d {}"},{"line_number":454,"context_line":"        # NOTE(sbauza): We consider that legacy names should just be avoided"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa32b979_95c76f97","line":451,"updated":"2015-06-17 15:18:08.000000000","message":"I should comment on the previous patch too - but to_dict is a poor name as it implies that this is a generally useful method. It\u0027s not. It shouhld only be used for backwards compatibility","commit_id":"9de0d32e440c26c736fafabd3f224b1121559b7c"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"c26bad08972f7cb2393b1881fcc66e7f04a9fa36","unresolved":false,"context_lines":[{"line_number":455,"context_line":"        # when recreating a dict for keys"},{"line_number":456,"context_line":"        self._set_dict_from_current_names(props)"},{"line_number":457,"context_line":"        return props"},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"    def get(self, name, defvalue\u003dNone):"},{"line_number":460,"context_line":"        \"\"\"Get the value of an attribute"},{"line_number":461,"context_line":"        :param name: the attribute to request"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa32b979_3671a50f","line":458,"updated":"2015-06-18 10:11:31.000000000","message":"On thinking about this some more, I\u0027m actually wondering if we can avoid creating this to_dict method at all.\n\nI\u0027m unclear on exactly how this is being used in the request spec and in particular what kind of back compat requirements we have in whatever later consumes the serialized dict.  \n\nIdeally though, the request spec would use the standardized serialization format, by just calling \u0027json.dumps(image.obj_to_primitive())\u0027 and when later loading it use Image.obj_from_primitive(json.loads(serializeddata))\n\nThis would avoid the to_dict method entirely, and is how we serialize the NUMA topology data for example.","commit_id":"8b9d25b54b2f46efa561e3913b1b6fe99e94c228"}]}
