)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"bd2e48fdc38e7b0622e908226da765edbef82271","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Prior to this patch, saving a ComputeNode with a pci_device_pools attribute"},{"line_number":10,"context_line":"that has no objects specified in it (empty PciDevicePool list) would result in"},{"line_number":11,"context_line":"the change not being saved.  Object of type PciDevicePoolList are evaluated"},{"line_number":12,"context_line":"like a list, thefore a conditionnal statement like \u0027if pools\u0027 will always"},{"line_number":13,"context_line":"evaluate to False even if \u0027pools\u0027 is not None."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Without this fix, if \u0027pci_passthrough_whitelist\u0027 is cleared in the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"da20952f_c1d704be","line":12,"updated":"2015-09-01 21:03:09.000000000","message":"spelling...should be \"conditional\"","commit_id":"8be78da1706e66fd0e02d97d2f3fd44f1e7d0f76"}],"nova/objects/compute_node.py":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"bd2e48fdc38e7b0622e908226da765edbef82271","unresolved":false,"context_lines":[{"line_number":246,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":247,"context_line":"        pools \u003d updates.pop(\u0027pci_device_pools\u0027, None)"},{"line_number":248,"context_line":"        # Object of type PciDevicePoolList is evaluated like a list"},{"line_number":249,"context_line":"        # (ObjectListBase).  Therefore if \u0027objects\u0027 list is empty, it will"},{"line_number":250,"context_line":"        # never be updated in the database."},{"line_number":251,"context_line":"        if pools is not None:"},{"line_number":252,"context_line":"            updates[\u0027pci_stats\u0027] \u003d jsonutils.dumps(pools.obj_to_primitive())"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_413534f5","line":249,"updated":"2015-09-01 21:03:09.000000000","message":"The message \"Therefore if \u0027objects\u0027 list is empty, it will never be updated in the database.\" doesn\u0027t apply after your code change.  Maybe use something like:\n\n\"We want to update if the list is empty, so test against None instead of treating it like a boolean.\"","commit_id":"8be78da1706e66fd0e02d97d2f3fd44f1e7d0f76"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"2d0e4c01bf1d0e263eac9e70ca7db4b7abb14e9c","unresolved":false,"context_lines":[{"line_number":246,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":247,"context_line":"        pools \u003d updates.pop(\u0027pci_device_pools\u0027, None)"},{"line_number":248,"context_line":"        # Object of type PciDevicePoolList is evaluated like a list"},{"line_number":249,"context_line":"        # (ObjectListBase).  Therefore if \u0027objects\u0027 list is empty, it will"},{"line_number":250,"context_line":"        # never be updated in the database."},{"line_number":251,"context_line":"        if pools is not None:"},{"line_number":252,"context_line":"            updates[\u0027pci_stats\u0027] \u003d jsonutils.dumps(pools.obj_to_primitive())"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_5804127d","line":249,"updated":"2015-08-24 16:02:26.000000000","message":"is \u0027objects\u0027 -\u003e \u0027pools\u0027?","commit_id":"8be78da1706e66fd0e02d97d2f3fd44f1e7d0f76"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"2e73c930dd19a3123d873aa639466c9d33e86299","unresolved":false,"context_lines":[{"line_number":246,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":247,"context_line":"        pools \u003d updates.pop(\u0027pci_device_pools\u0027, None)"},{"line_number":248,"context_line":"        # Object of type PciDevicePoolList is evaluated like a list"},{"line_number":249,"context_line":"        # (ObjectListBase).  Therefore if \u0027objects\u0027 list is empty, it will"},{"line_number":250,"context_line":"        # never be updated in the database."},{"line_number":251,"context_line":"        if pools is not None:"},{"line_number":252,"context_line":"            updates[\u0027pci_stats\u0027] \u003d jsonutils.dumps(pools.obj_to_primitive())"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_cc671824","line":249,"in_reply_to":"da20952f_413534f5","updated":"2015-09-02 13:39:17.000000000","message":"Done","commit_id":"8be78da1706e66fd0e02d97d2f3fd44f1e7d0f76"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"515081a13da21b1df42166a6e3051e876789ec43","unresolved":false,"context_lines":[{"line_number":246,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":247,"context_line":"        pools \u003d updates.pop(\u0027pci_device_pools\u0027, None)"},{"line_number":248,"context_line":"        # Object of type PciDevicePoolList is evaluated like a list"},{"line_number":249,"context_line":"        # (ObjectListBase).  Therefore if \u0027objects\u0027 list is empty, it will"},{"line_number":250,"context_line":"        # never be updated in the database."},{"line_number":251,"context_line":"        if pools is not None:"},{"line_number":252,"context_line":"            updates[\u0027pci_stats\u0027] \u003d jsonutils.dumps(pools.obj_to_primitive())"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_6e502c0b","line":249,"in_reply_to":"fa1b9901_537953fb","updated":"2015-08-24 16:19:27.000000000","message":"ok ~thx","commit_id":"8be78da1706e66fd0e02d97d2f3fd44f1e7d0f76"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"947e2d6f84821865c2ca516b03da19078e9cb6c8","unresolved":false,"context_lines":[{"line_number":246,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":247,"context_line":"        pools \u003d updates.pop(\u0027pci_device_pools\u0027, None)"},{"line_number":248,"context_line":"        # Object of type PciDevicePoolList is evaluated like a list"},{"line_number":249,"context_line":"        # (ObjectListBase).  Therefore if \u0027objects\u0027 list is empty, it will"},{"line_number":250,"context_line":"        # never be updated in the database."},{"line_number":251,"context_line":"        if pools is not None:"},{"line_number":252,"context_line":"            updates[\u0027pci_stats\u0027] \u003d jsonutils.dumps(pools.obj_to_primitive())"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_537953fb","line":249,"in_reply_to":"fa1b9901_5804127d","updated":"2015-08-24 16:14:20.000000000","message":"\u0027pools\u0027 is of type PciDevicePoolList.  PciDevicePoolList has one attribute \u0027objects\u0027 which is a list of PciDevicePool.","commit_id":"8be78da1706e66fd0e02d97d2f3fd44f1e7d0f76"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"70e481c2922588b1c22187d52bbdf28960d9006d","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        # NOTE(pmurray): the pci_device_pools field maps to the"},{"line_number":80,"context_line":"        # pci_stats field in the database"},{"line_number":81,"context_line":"        \u0027pci_device_pools\u0027: fields.ObjectField(\u0027PciDevicePoolList\u0027,"},{"line_number":82,"context_line":"                                               nullable\u003dTrue),"},{"line_number":83,"context_line":"        \u0027cpu_allocation_ratio\u0027: fields.FloatField(),"},{"line_number":84,"context_line":"        \u0027ram_allocation_ratio\u0027: fields.FloatField(),"},{"line_number":85,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_dd200f9e","line":82,"updated":"2015-11-17 13:59:46.000000000","message":"This is nullable, so don\u0027t we need some way to deal with setting this to None?","commit_id":"221efef0a57f31a2170766b5463cc1138716f0bb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"70e481c2922588b1c22187d52bbdf28960d9006d","unresolved":false,"context_lines":[{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    @staticmethod"},{"line_number":286,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":287,"context_line":"        pools \u003d updates.pop(\u0027pci_device_pools\u0027, None)"},{"line_number":288,"context_line":"        # We want to update if the list is empty, so test against None instead"},{"line_number":289,"context_line":"        # of treating it like a boolean."},{"line_number":290,"context_line":"        if pools is not None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_5ebad2c1","line":287,"updated":"2015-11-17 13:59:46.000000000","message":"what about trying\n\nif \u0027pci_device_pools\u0027 in updates\n\nIt used else where to avoid these issues:\nhttps://github.com/openstack/nova/blob/master/nova/objects/fixed_ip.py#L182","commit_id":"221efef0a57f31a2170766b5463cc1138716f0bb"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"f0f983887b2befd03e5638db263b93450e819af8","unresolved":false,"context_lines":[{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    @staticmethod"},{"line_number":286,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":287,"context_line":"        pools \u003d updates.pop(\u0027pci_device_pools\u0027, None)"},{"line_number":288,"context_line":"        # We want to update if the list is empty, so test against None instead"},{"line_number":289,"context_line":"        # of treating it like a boolean."},{"line_number":290,"context_line":"        if pools is not None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_27e0da28","line":287,"in_reply_to":"ba8a016a_5ebad2c1","updated":"2015-11-18 16:52:22.000000000","message":"Done","commit_id":"221efef0a57f31a2170766b5463cc1138716f0bb"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"3f75d767e67fc239657fde55d8a17ab8aa015115","unresolved":false,"context_lines":[{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    @staticmethod"},{"line_number":286,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":287,"context_line":"        pools \u003d updates.pop(\u0027pci_device_pools\u0027, None)"},{"line_number":288,"context_line":"        # We want to update if the list is empty, so test against None instead"},{"line_number":289,"context_line":"        # of treating it like a boolean."},{"line_number":290,"context_line":"        if pools is not None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_347a8df2","line":287,"in_reply_to":"ba8a016a_5ebad2c1","updated":"2015-11-17 14:27:17.000000000","message":"Thanks for the pointer.  I\u0027ll try it out.","commit_id":"221efef0a57f31a2170766b5463cc1138716f0bb"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"2dc8ba40db04186d891861d79b54bf5bcb23eca3","unresolved":false,"context_lines":[{"line_number":281,"context_line":""},{"line_number":282,"context_line":"    @staticmethod"},{"line_number":283,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":284,"context_line":"        if \u0027pci_device_pools\u0027 in updates.keys():"},{"line_number":285,"context_line":"            pools \u003d updates.pop(\u0027pci_device_pools\u0027, None)"},{"line_number":286,"context_line":"            updates[\u0027pci_stats\u0027] \u003d jsonutils.dumps(pools.obj_to_primitive())"},{"line_number":287,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a8ffd7b_0f74efcc","line":284,"updated":"2015-11-26 06:20:54.000000000","message":"you don\u0027t need the to call  updates.keys() you can just do  in updates it is faster see \nhttp://stackoverflow.com/questions/1602934/check-if-a-given-key-already-exists-in-a-dictionary/1602944#1602944","commit_id":"faf03c4bbddfc9954eca2e9e7769eb0560745b09"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"f6008179533316baf320ee3235cee8185e542e78","unresolved":false,"context_lines":[{"line_number":281,"context_line":""},{"line_number":282,"context_line":"    @staticmethod"},{"line_number":283,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":284,"context_line":"        if \u0027pci_device_pools\u0027 in updates.keys():"},{"line_number":285,"context_line":"            pools \u003d updates.pop(\u0027pci_device_pools\u0027, None)"},{"line_number":286,"context_line":"            updates[\u0027pci_stats\u0027] \u003d jsonutils.dumps(pools.obj_to_primitive())"},{"line_number":287,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a8ffd7b_4b1ffd07","line":284,"in_reply_to":"9a8ffd7b_0f74efcc","updated":"2015-11-27 14:50:22.000000000","message":"Done","commit_id":"faf03c4bbddfc9954eca2e9e7769eb0560745b09"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"2dc8ba40db04186d891861d79b54bf5bcb23eca3","unresolved":false,"context_lines":[{"line_number":282,"context_line":"    @staticmethod"},{"line_number":283,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":284,"context_line":"        if \u0027pci_device_pools\u0027 in updates.keys():"},{"line_number":285,"context_line":"            pools \u003d updates.pop(\u0027pci_device_pools\u0027, None)"},{"line_number":286,"context_line":"            updates[\u0027pci_stats\u0027] \u003d jsonutils.dumps(pools.obj_to_primitive())"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"    @base.remotable"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a8ffd7b_6a4ec970","line":285,"updated":"2015-11-26 06:20:54.000000000","message":"why do you need to put the default value None in pop?\nyou already validate that it exists\n\nmaybe I am mistaken here but, is it possible that you will get dict with \n{ \u0027pci_device_pools\u0027\u0027: None} and not versioned object. so maybe it is worth to keep the \"if pool: \" line","commit_id":"faf03c4bbddfc9954eca2e9e7769eb0560745b09"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"f6008179533316baf320ee3235cee8185e542e78","unresolved":false,"context_lines":[{"line_number":282,"context_line":"    @staticmethod"},{"line_number":283,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":284,"context_line":"        if \u0027pci_device_pools\u0027 in updates.keys():"},{"line_number":285,"context_line":"            pools \u003d updates.pop(\u0027pci_device_pools\u0027, None)"},{"line_number":286,"context_line":"            updates[\u0027pci_stats\u0027] \u003d jsonutils.dumps(pools.obj_to_primitive())"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"    @base.remotable"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a8ffd7b_c6d9a458","line":285,"in_reply_to":"9a8ffd7b_6a4ec970","updated":"2015-11-27 14:50:22.000000000","message":"I\u0027ve added \"if pools is not None:\"\n\nIt\u0027s possible that pools\u003d[], in which case \"if pools\" will evalute as False, but we still want to update the value with [].","commit_id":"faf03c4bbddfc9954eca2e9e7769eb0560745b09"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"3dd0f6960a26607135ea9f98c4176b9ba88f928f","unresolved":false,"context_lines":[{"line_number":283,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":284,"context_line":"        if \u0027pci_device_pools\u0027 in updates:"},{"line_number":285,"context_line":"            pools \u003d updates.pop(\u0027pci_device_pools\u0027)"},{"line_number":286,"context_line":"            if pools is not None:"},{"line_number":287,"context_line":"                updates[\u0027pci_stats\u0027] \u003d jsonutils.dumps("},{"line_number":288,"context_line":"                    pools.obj_to_primitive())"},{"line_number":289,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_19689e86","line":286,"range":{"start_line":286,"start_character":20,"end_line":286,"end_character":32},"updated":"2016-01-05 13:23:12.000000000","message":"So looking at john\u0027s comment this would still not allow us to save a None?","commit_id":"b82a4fd3c42b972947ab74a1ff3bb7f3a9789a8d"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"174057ece1efc622f9f7c4693a381bacf0f27bc1","unresolved":false,"context_lines":[{"line_number":283,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":284,"context_line":"        if \u0027pci_device_pools\u0027 in updates:"},{"line_number":285,"context_line":"            pools \u003d updates.pop(\u0027pci_device_pools\u0027)"},{"line_number":286,"context_line":"            if pools is not None:"},{"line_number":287,"context_line":"                updates[\u0027pci_stats\u0027] \u003d jsonutils.dumps("},{"line_number":288,"context_line":"                    pools.obj_to_primitive())"},{"line_number":289,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5a5ae5dd_39b7c587","line":286,"range":{"start_line":286,"start_character":20,"end_line":286,"end_character":32},"in_reply_to":"fa69d971_19689e86","updated":"2016-02-04 20:38:48.000000000","message":"Done","commit_id":"b82a4fd3c42b972947ab74a1ff3bb7f3a9789a8d"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"4dc6aa6706f496856f161bee543ed0564c74950c","unresolved":false,"context_lines":[{"line_number":262,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":263,"context_line":"        if \u0027pci_device_pools\u0027 in updates:"},{"line_number":264,"context_line":"            pools \u003d updates.pop(\u0027pci_device_pools\u0027)"},{"line_number":265,"context_line":"            updates[\u0027pci_stats\u0027] \u003d jsonutils.dumps(pools.obj_to_primitive())"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    @base.remotable"},{"line_number":268,"context_line":"    def create(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a57f1b5_94db651b","line":265,"range":{"start_line":265,"start_character":51,"end_line":265,"end_character":73},"updated":"2016-02-10 13:29:23.000000000","message":"I think we also want to confirm that pools is not None before doing this. if it is None we just want to save it as is.","commit_id":"39155524a7aec99318b4212bb6cc66f8e8bbaf7b"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"853b05faea2075f6670337dd60b66069a36ec2b5","unresolved":false,"context_lines":[{"line_number":262,"context_line":"    def _convert_pci_stats_to_db_format(updates):"},{"line_number":263,"context_line":"        if \u0027pci_device_pools\u0027 in updates:"},{"line_number":264,"context_line":"            pools \u003d updates.pop(\u0027pci_device_pools\u0027)"},{"line_number":265,"context_line":"            updates[\u0027pci_stats\u0027] \u003d jsonutils.dumps(pools.obj_to_primitive())"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    @base.remotable"},{"line_number":268,"context_line":"    def create(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a57f1b5_f3fe2137","line":265,"range":{"start_line":265,"start_character":51,"end_line":265,"end_character":73},"in_reply_to":"3a57f1b5_94db651b","updated":"2016-02-11 16:11:11.000000000","message":"Done","commit_id":"39155524a7aec99318b4212bb6cc66f8e8bbaf7b"}],"nova/objects/pci_device_pool.py":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"bd2e48fdc38e7b0622e908226da765edbef82271","unresolved":false,"context_lines":[{"line_number":93,"context_line":"            pci_stats \u003d jsonutils.loads(pci_stats)"},{"line_number":94,"context_line":"        except (ValueError, TypeError):"},{"line_number":95,"context_line":"            pci_stats \u003d None"},{"line_number":96,"context_line":"    if pci_stats is not None:"},{"line_number":97,"context_line":"        # Check for object-ness, or old-style storage format."},{"line_number":98,"context_line":"        if \u0027nova_object.namespace\u0027 in pci_stats:"},{"line_number":99,"context_line":"            pools \u003d objects.PciDevicePoolList.obj_from_primitive(pci_stats)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_9c12d357","line":96,"updated":"2015-09-01 21:03:09.000000000","message":"Add a comment like \"We want to continue if pci_stats is an empty list, so test against None instead of treating it like a boolean.\"","commit_id":"8be78da1706e66fd0e02d97d2f3fd44f1e7d0f76"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"2e73c930dd19a3123d873aa639466c9d33e86299","unresolved":false,"context_lines":[{"line_number":93,"context_line":"            pci_stats \u003d jsonutils.loads(pci_stats)"},{"line_number":94,"context_line":"        except (ValueError, TypeError):"},{"line_number":95,"context_line":"            pci_stats \u003d None"},{"line_number":96,"context_line":"    if pci_stats is not None:"},{"line_number":97,"context_line":"        # Check for object-ness, or old-style storage format."},{"line_number":98,"context_line":"        if \u0027nova_object.namespace\u0027 in pci_stats:"},{"line_number":99,"context_line":"            pools \u003d objects.PciDevicePoolList.obj_from_primitive(pci_stats)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_ac30a408","line":96,"in_reply_to":"da20952f_9c12d357","updated":"2015-09-02 13:39:17.000000000","message":"Done","commit_id":"8be78da1706e66fd0e02d97d2f3fd44f1e7d0f76"}],"nova/tests/unit/compute/test_resource_tracker.py":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"bd2e48fdc38e7b0622e908226da765edbef82271","unresolved":false,"context_lines":[{"line_number":720,"context_line":"        self.assertEqual(0, self.tracker.compute_node.current_workload)"},{"line_number":721,"context_line":"        expected \u003d pci_device_pool.from_pci_stats(driver.pci_stats)"},{"line_number":722,"context_line":"        self.assertEqual(expected.objects,"},{"line_number":723,"context_line":"                         self.tracker.compute_node.pci_device_pools.objects)"},{"line_number":724,"context_line":""},{"line_number":725,"context_line":"    def test_set_instance_host_and_node(self):"},{"line_number":726,"context_line":"        inst \u003d objects.Instance()"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_fc5aef29","line":723,"updated":"2015-09-01 21:03:09.000000000","message":"why is this change needed?","commit_id":"8be78da1706e66fd0e02d97d2f3fd44f1e7d0f76"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"2e73c930dd19a3123d873aa639466c9d33e86299","unresolved":false,"context_lines":[{"line_number":720,"context_line":"        self.assertEqual(0, self.tracker.compute_node.current_workload)"},{"line_number":721,"context_line":"        expected \u003d pci_device_pool.from_pci_stats(driver.pci_stats)"},{"line_number":722,"context_line":"        self.assertEqual(expected.objects,"},{"line_number":723,"context_line":"                         self.tracker.compute_node.pci_device_pools.objects)"},{"line_number":724,"context_line":""},{"line_number":725,"context_line":"    def test_set_instance_host_and_node(self):"},{"line_number":726,"context_line":"        inst \u003d objects.Instance()"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_c2e121d2","line":723,"in_reply_to":"da20952f_fc5aef29","updated":"2015-09-02 13:39:17.000000000","message":"Done","commit_id":"8be78da1706e66fd0e02d97d2f3fd44f1e7d0f76"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"70e481c2922588b1c22187d52bbdf28960d9006d","unresolved":false,"context_lines":[{"line_number":709,"context_line":"        self.assertEqual(0, self.tracker.compute_node.current_workload)"},{"line_number":710,"context_line":"        expected_pools \u003d pci_device_pool.from_pci_stats(driver.pci_stats)"},{"line_number":711,"context_line":"        self.assertEqualPciDevicePoolList(expected_pools,"},{"line_number":712,"context_line":"            self.tracker.compute_node.pci_device_pools)"},{"line_number":713,"context_line":""},{"line_number":714,"context_line":"    def test_set_instance_host_and_node(self):"},{"line_number":715,"context_line":"        inst \u003d objects.Instance()"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_421c3e77","line":712,"updated":"2015-11-17 13:59:46.000000000","message":"This almost feels like an unrelated change?","commit_id":"221efef0a57f31a2170766b5463cc1138716f0bb"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"f0f983887b2befd03e5638db263b93450e819af8","unresolved":false,"context_lines":[{"line_number":709,"context_line":"        self.assertEqual(0, self.tracker.compute_node.current_workload)"},{"line_number":710,"context_line":"        expected_pools \u003d pci_device_pool.from_pci_stats(driver.pci_stats)"},{"line_number":711,"context_line":"        self.assertEqualPciDevicePoolList(expected_pools,"},{"line_number":712,"context_line":"            self.tracker.compute_node.pci_device_pools)"},{"line_number":713,"context_line":""},{"line_number":714,"context_line":"    def test_set_instance_host_and_node(self):"},{"line_number":715,"context_line":"        inst \u003d objects.Instance()"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_e79df266","line":712,"in_reply_to":"ba8a016a_421c3e77","updated":"2015-11-18 16:52:22.000000000","message":"This is related to the change.\n\nBefore this change, expected_pools and self.tracker.compute_node.pci_device_pools were both None.\n\nBut with the change, self.tracker.compute_node.pci_device_pools is now PciDevicePoolList(objects\u003d[]).\n\nThis is why I had to modify pci_device_pool.from_pci_stats to properly return an empty PciDevicePoolList.\n\nFurthermore, assertEqual was failing because it was trying to compare two objects.  Now using assertEqualPciDevicePoolList correctly compare the content of the objects.","commit_id":"221efef0a57f31a2170766b5463cc1138716f0bb"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"1b846bb4f14636b476db61bc3d773a3e5dd510f5","unresolved":false,"context_lines":[{"line_number":713,"context_line":"                         len(self.tracker.compute_node.pci_device_pools))"},{"line_number":714,"context_line":"        for expected_pool, actual_pool in zip("},{"line_number":715,"context_line":"                expected, self.tracker.compute_node.pci_device_pools):"},{"line_number":716,"context_line":"            self.assertEqualPciDevicePoolList(expected_pool, actual_pool)"},{"line_number":717,"context_line":""},{"line_number":718,"context_line":"    def test_set_instance_host_and_node(self):"},{"line_number":719,"context_line":"        inst \u003d objects.Instance()"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_9dcc4cbc","line":716,"range":{"start_line":716,"start_character":17,"end_line":716,"end_character":45},"updated":"2015-12-08 13:51:41.000000000","message":"So this makes sure we get the expected object, however we want to make sure that even an empty list does not result in a None but in an empty object.","commit_id":"1dbd11144aa6b943d0a7cfd80e9bb8e8de425273"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"53f62b86b8173b2ab68f6c15365d6d2c58857bc2","unresolved":false,"context_lines":[{"line_number":713,"context_line":"                         len(self.tracker.compute_node.pci_device_pools))"},{"line_number":714,"context_line":"        for expected_pool, actual_pool in zip("},{"line_number":715,"context_line":"                expected, self.tracker.compute_node.pci_device_pools):"},{"line_number":716,"context_line":"            self.assertEqualPciDevicePoolList(expected_pool, actual_pool)"},{"line_number":717,"context_line":""},{"line_number":718,"context_line":"    def test_set_instance_host_and_node(self):"},{"line_number":719,"context_line":"        inst \u003d objects.Instance()"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_fed9bbf3","line":716,"in_reply_to":"7a740942_9dcc4cbc","updated":"2015-12-08 17:26:56.000000000","message":"It appears that the changes to PciDevicePool.from_pci_stats are not needed anymore since I re-implemented _convert_pci_stats_to_db_format based on John\u0027s comment.\n\nPlease have a look at latest patch set revision 8.","commit_id":"1dbd11144aa6b943d0a7cfd80e9bb8e8de425273"}],"nova/tests/unit/objects/test_compute_node.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"fc2310d524d136c1c2f039db7694860178303b4c","unresolved":false,"context_lines":[{"line_number":350,"context_line":"        _fake_compute_node[\u0027pci_stats\u0027] \u003d _fake_pci"},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"        self.mox.StubOutWithMock(db, \u0027compute_node_update\u0027)"},{"line_number":353,"context_line":"        db.compute_node_update("},{"line_number":354,"context_line":"            self.context, 123,"},{"line_number":355,"context_line":"            {"},{"line_number":356,"context_line":"                \u0027pci_stats\u0027: _fake_pci,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa1b9901_0920929a","line":353,"updated":"2015-08-24 14:25:44.000000000","message":"Test is good and reflect well the database call. Unfortunately we prefer new tests introduced using mock. Can you update your code?","commit_id":"e46d4985dd57a88991ad96cd135be779a4d22400"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"190fc41c5d77377decae4d0c93775603070e1e8d","unresolved":false,"context_lines":[{"line_number":350,"context_line":"        _fake_compute_node[\u0027pci_stats\u0027] \u003d _fake_pci"},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"        self.mox.StubOutWithMock(db, \u0027compute_node_update\u0027)"},{"line_number":353,"context_line":"        db.compute_node_update("},{"line_number":354,"context_line":"            self.context, 123,"},{"line_number":355,"context_line":"            {"},{"line_number":356,"context_line":"                \u0027pci_stats\u0027: _fake_pci,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa1b9901_fd2158fd","line":353,"in_reply_to":"fa1b9901_0920929a","updated":"2015-08-24 15:44:21.000000000","message":"Thanks !  Fixed in patch set 3.","commit_id":"e46d4985dd57a88991ad96cd135be779a4d22400"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"bd2e48fdc38e7b0622e908226da765edbef82271","unresolved":false,"context_lines":[{"line_number":347,"context_line":"        _fake_pci \u003d jsonutils.dumps("},{"line_number":348,"context_line":"            objects.PciDevicePoolList(objects\u003d[]).obj_to_primitive())"},{"line_number":349,"context_line":"        _fake_compute_node \u003d fake_compute_node.copy()"},{"line_number":350,"context_line":"        _fake_compute_node[\u0027pci_stats\u0027] \u003d _fake_pci"},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"        with mock.patch.object("},{"line_number":353,"context_line":"                db, \u0027compute_node_update\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_1c9a43c6","line":350,"updated":"2015-09-01 21:03:09.000000000","message":"I wouldn\u0027t bother with the leading underscore here.","commit_id":"8be78da1706e66fd0e02d97d2f3fd44f1e7d0f76"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"2e73c930dd19a3123d873aa639466c9d33e86299","unresolved":false,"context_lines":[{"line_number":347,"context_line":"        _fake_pci \u003d jsonutils.dumps("},{"line_number":348,"context_line":"            objects.PciDevicePoolList(objects\u003d[]).obj_to_primitive())"},{"line_number":349,"context_line":"        _fake_compute_node \u003d fake_compute_node.copy()"},{"line_number":350,"context_line":"        _fake_compute_node[\u0027pci_stats\u0027] \u003d _fake_pci"},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"        with mock.patch.object("},{"line_number":353,"context_line":"                db, \u0027compute_node_update\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_e25465cb","line":350,"in_reply_to":"da20952f_1c9a43c6","updated":"2015-09-02 13:39:17.000000000","message":"Done","commit_id":"8be78da1706e66fd0e02d97d2f3fd44f1e7d0f76"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"bd2e48fdc38e7b0622e908226da765edbef82271","unresolved":false,"context_lines":[{"line_number":351,"context_line":""},{"line_number":352,"context_line":"        with mock.patch.object("},{"line_number":353,"context_line":"                db, \u0027compute_node_update\u0027,"},{"line_number":354,"context_line":"                return_value\u003d_fake_compute_node) as mock_method:"},{"line_number":355,"context_line":"            compute \u003d compute_node.ComputeNode(context\u003dself.context)"},{"line_number":356,"context_line":"            compute.id \u003d 123"},{"line_number":357,"context_line":"            compute.pci_device_pools \u003d objects.PciDevicePoolList(objects\u003d[])"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_bcd9d785","line":354,"updated":"2015-09-01 21:03:09.000000000","message":"it would be slightly more clear to use mock_compute_node_update instead of mock_method","commit_id":"8be78da1706e66fd0e02d97d2f3fd44f1e7d0f76"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"2e73c930dd19a3123d873aa639466c9d33e86299","unresolved":false,"context_lines":[{"line_number":351,"context_line":""},{"line_number":352,"context_line":"        with mock.patch.object("},{"line_number":353,"context_line":"                db, \u0027compute_node_update\u0027,"},{"line_number":354,"context_line":"                return_value\u003d_fake_compute_node) as mock_method:"},{"line_number":355,"context_line":"            compute \u003d compute_node.ComputeNode(context\u003dself.context)"},{"line_number":356,"context_line":"            compute.id \u003d 123"},{"line_number":357,"context_line":"            compute.pci_device_pools \u003d objects.PciDevicePoolList(objects\u003d[])"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_627b757c","line":354,"in_reply_to":"da20952f_bcd9d785","updated":"2015-09-02 13:39:17.000000000","message":"Done","commit_id":"8be78da1706e66fd0e02d97d2f3fd44f1e7d0f76"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"4dc6aa6706f496856f161bee543ed0564c74950c","unresolved":false,"context_lines":[{"line_number":276,"context_line":"                         comparators\u003dself.comparators())"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"    def test_save_pci_device_pools_empty(self):"},{"line_number":279,"context_line":"        fake_pci \u003d jsonutils.dumps("},{"line_number":280,"context_line":"            objects.PciDevicePoolList(objects\u003d[]).obj_to_primitive())"},{"line_number":281,"context_line":"        compute_dict \u003d fake_compute_node.copy()"},{"line_number":282,"context_line":"        compute_dict[\u0027pci_stats\u0027] \u003d fake_pci"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a57f1b5_b446a1bd","line":279,"range":{"start_line":279,"start_character":8,"end_line":279,"end_character":16},"updated":"2016-02-10 13:29:23.000000000","message":"Would be awesome to have a None test case as well since the field is nullable.","commit_id":"39155524a7aec99318b4212bb6cc66f8e8bbaf7b"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"853b05faea2075f6670337dd60b66069a36ec2b5","unresolved":false,"context_lines":[{"line_number":276,"context_line":"                         comparators\u003dself.comparators())"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"    def test_save_pci_device_pools_empty(self):"},{"line_number":279,"context_line":"        fake_pci \u003d jsonutils.dumps("},{"line_number":280,"context_line":"            objects.PciDevicePoolList(objects\u003d[]).obj_to_primitive())"},{"line_number":281,"context_line":"        compute_dict \u003d fake_compute_node.copy()"},{"line_number":282,"context_line":"        compute_dict[\u0027pci_stats\u0027] \u003d fake_pci"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a57f1b5_b3f8a94a","line":279,"range":{"start_line":279,"start_character":8,"end_line":279,"end_character":16},"in_reply_to":"3a57f1b5_b446a1bd","updated":"2016-02-11 16:11:11.000000000","message":"Done","commit_id":"39155524a7aec99318b4212bb6cc66f8e8bbaf7b"}]}
