)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"4a44fb87f03f454e59d307588a8a9e140e0198ab","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Make sriov agent to set the spoofchecking on VFs"},{"line_number":10,"context_line":"according to port_security_enabled attribute of the port."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Blueprint: sriov-spoofchk"},{"line_number":13,"context_line":"Change-Id: I4d1060be26ee6cbd7d766c2bde364f694533de69"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"ba3cc151_511f9e5a","line":12,"updated":"2015-07-02 13:35:15.000000000","message":"Implements: blueprint sriov-spoofchk","commit_id":"9972114517edc23a10a9c10f41974e18d87319fe"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"204869e8a21fe2afafbcfe73a068e360b9d1d016","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Make sriov agent to set the spoofchecking on VFs"},{"line_number":10,"context_line":"according to port_security_enabled attribute of the port."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Blueprint: sriov-spoofchk"},{"line_number":13,"context_line":"Change-Id: I4d1060be26ee6cbd7d766c2bde364f694533de69"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"ba3cc151_dc24d0c7","line":12,"in_reply_to":"ba3cc151_511f9e5a","updated":"2015-07-06 06:47:45.000000000","message":"Done","commit_id":"9972114517edc23a10a9c10f41974e18d87319fe"}],"neutron/plugins/ml2/drivers/mech_sriov/agent/eswitch_manager.py":[{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"b7abb6dd8fc41fc0ead107bf4ac05b1b44537e9d","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        Sets device spoofchecking (enabled or disabled)"},{"line_number":270,"context_line":"        @param device_mac: device mac"},{"line_number":271,"context_line":"        @param pci_slot: pci slot"},{"line_number":272,"context_line":"        @param admin_state_up: device spoofchecking"},{"line_number":273,"context_line":"        \"\"\""},{"line_number":274,"context_line":"        embedded_switch \u003d self._get_emb_eswitch(device_mac, pci_slot)"},{"line_number":275,"context_line":"        if embedded_switch:"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_0b3d9ec3","line":272,"updated":"2015-07-01 14:16:33.000000000","message":"admin_state_up -\u003e enabled?","commit_id":"ca1e15f5e782f4289d3926319c5fd31d468e27fb"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"06e5408794a60ea12cd87b97af9e2e7dee1166af","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        Sets device spoofchecking (enabled or disabled)"},{"line_number":270,"context_line":"        @param device_mac: device mac"},{"line_number":271,"context_line":"        @param pci_slot: pci slot"},{"line_number":272,"context_line":"        @param admin_state_up: device spoofchecking"},{"line_number":273,"context_line":"        \"\"\""},{"line_number":274,"context_line":"        embedded_switch \u003d self._get_emb_eswitch(device_mac, pci_slot)"},{"line_number":275,"context_line":"        if embedded_switch:"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_7d7bac28","line":272,"in_reply_to":"ba3cc151_0b3d9ec3","updated":"2015-07-02 04:25:10.000000000","message":"Done","commit_id":"ca1e15f5e782f4289d3926319c5fd31d468e27fb"}],"neutron/plugins/ml2/drivers/mech_sriov/agent/pci_lib.py":[{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"deb6a449e4541649e666facbe431bf7ce7cfa055","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        try:"},{"line_number":119,"context_line":"            self._execute(\u0027\u0027, \"link\", (\"set\", self.dev_name, \"vf\","},{"line_number":120,"context_line":"                                       str(vf_index), \"spoofchk\", setting))"},{"line_number":121,"context_line":"        except Exception as e:"},{"line_number":122,"context_line":"            raise exc.IpCommandError(dev_name\u003dself.dev_name,"},{"line_number":123,"context_line":"                                     reason\u003dstr(e))"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a50d1a3_726f1960","line":120,"updated":"2015-07-29 15:08:52.000000000","message":"I just found out the in the pci_lib the ip link commands are not executed.  there are 2 issues:\n1. it should be   self._execute(\u0027[], \"link\", ...\n\n2. I think it should run as root \n\ndid it work for you like that?","commit_id":"6bcbadd19d7bb711550b0577f725d4e36c6b13a4"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"59d46537868b72de8d94dac3af6fb9ba94ffabef","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        try:"},{"line_number":119,"context_line":"            self._execute(\u0027\u0027, \"link\", (\"set\", self.dev_name, \"vf\","},{"line_number":120,"context_line":"                                       str(vf_index), \"spoofchk\", setting))"},{"line_number":121,"context_line":"        except Exception as e:"},{"line_number":122,"context_line":"            raise exc.IpCommandError(dev_name\u003dself.dev_name,"},{"line_number":123,"context_line":"                                     reason\u003dstr(e))"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a50d1a3_a3d0f51f","line":120,"in_reply_to":"3a50d1a3_726f1960","updated":"2015-07-29 15:50:52.000000000","message":"Hm, did you try to deploy live? It works for me, please see comments below:\n\n1. \u0027\u0027 and [] have the same effect here, as SubProcessBase._execute does the following:\n\n   opt_list \u003d [\u0027-%s\u0027 % o for o in options], where options is either \u0027\u0027 or [], result is still [].\n\nIt\u0027s used all over the place in pci_lib this way, so I kept the same style.\n\n2. I run sriov-nic-agent as root even without this patch. If you look at the very next function above, set_vf_state, it does NOT set \u0027run_as_root\u003dTrue\u0027, so it needs root anyway. So, again, I just used the same pattern as the existing functions use.\n\nDid I miss something?","commit_id":"6bcbadd19d7bb711550b0577f725d4e36c6b13a4"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"f3aed8220fe863b2bdd403cee6559d13fb1ac90b","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        try:"},{"line_number":119,"context_line":"            self._execute(\u0027\u0027, \"link\", (\"set\", self.dev_name, \"vf\","},{"line_number":120,"context_line":"                                       str(vf_index), \"spoofchk\", setting))"},{"line_number":121,"context_line":"        except Exception as e:"},{"line_number":122,"context_line":"            raise exc.IpCommandError(dev_name\u003dself.dev_name,"},{"line_number":123,"context_line":"                                     reason\u003dstr(e))"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a50d1a3_033c49df","line":120,"in_reply_to":"3a50d1a3_a3d0f51f","updated":"2015-07-29 16:00:06.000000000","message":"ok Now I see, \nso our QA  check it with packstack RDO. \nand the agent run as neutron user so that way it failed. \nwe should update everything to run_as_root.\n\ncan you update you code to be with _as_root(.... ? \nI will send another patch that fix the others","commit_id":"6bcbadd19d7bb711550b0577f725d4e36c6b13a4"}],"neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py":[{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"4a44fb87f03f454e59d307588a8a9e140e0198ab","unresolved":false,"context_lines":[{"line_number":174,"context_line":"            try:"},{"line_number":175,"context_line":"                self.eswitch_mgr.set_device_spoofcheck(device, pci_slot,"},{"line_number":176,"context_line":"                                                       spoofcheck)"},{"line_number":177,"context_line":"            except Exception:"},{"line_number":178,"context_line":"                LOG.warning(_LW(\"Failed to set spoofcheck for device %s\"),"},{"line_number":179,"context_line":"                            device)"},{"line_number":180,"context_line":"            LOG.info(_LI(\"Device %(device)s spoofcheck %(spoofcheck)s\"),"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_51a47e06","line":177,"updated":"2015-07-02 13:35:15.000000000","message":"Is there an implication of this not being set that should be handled here? Currently, it logs a warning and continues on it\u0027s way.","commit_id":"9972114517edc23a10a9c10f41974e18d87319fe"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"963bffe1c2749ea1800fb39712b98e862d06d2b0","unresolved":false,"context_lines":[{"line_number":174,"context_line":"            try:"},{"line_number":175,"context_line":"                self.eswitch_mgr.set_device_spoofcheck(device, pci_slot,"},{"line_number":176,"context_line":"                                                       spoofcheck)"},{"line_number":177,"context_line":"            except Exception:"},{"line_number":178,"context_line":"                LOG.warning(_LW(\"Failed to set spoofcheck for device %s\"),"},{"line_number":179,"context_line":"                            device)"},{"line_number":180,"context_line":"            LOG.info(_LI(\"Device %(device)s spoofcheck %(spoofcheck)s\"),"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_eb7d7e6d","line":177,"in_reply_to":"ba3cc151_51a47e06","updated":"2015-07-03 07:12:43.000000000","message":"My idea was that as by default spoof checking is enabled (at least for Intel devices; and that\u0027s a reasonable default), the worst case could be that when it fails, user would have more secure setup instead of less secure he requested (i.e. when he requested no spoof checking).\n\nAdditionally, I can hardly imagine a situation where setting spoofchecking could fail unless things are going horribly wrong (e.g. user decreases value of sriov_numvfs, unloads the driver, breaks iproute2), but it\u0027ll fail earlier anyway in these cases.","commit_id":"9972114517edc23a10a9c10f41974e18d87319fe"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"40c6fc6ed87a930f0eb7456eef0b8456b95f408a","unresolved":false,"context_lines":[{"line_number":174,"context_line":"            try:"},{"line_number":175,"context_line":"                self.eswitch_mgr.set_device_spoofcheck(device, pci_slot,"},{"line_number":176,"context_line":"                                                       spoofcheck)"},{"line_number":177,"context_line":"            except Exception:"},{"line_number":178,"context_line":"                LOG.warning(_LW(\"Failed to set spoofcheck for device %s\"),"},{"line_number":179,"context_line":"                            device)"},{"line_number":180,"context_line":"            LOG.info(_LI(\"Device %(device)s spoofcheck %(spoofcheck)s\"),"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_083e60b8","line":177,"in_reply_to":"ba3cc151_eb7d7e6d","updated":"2015-07-06 15:07:16.000000000","message":"I think such failures, not only port security, could be potentially mapped to port status and maybe additional field to report port failure to the user. But this is beyond the scope of this patch.","commit_id":"9972114517edc23a10a9c10f41974e18d87319fe"}],"neutron/plugins/sriovnicagent/eswitch_manager.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"44cb1adb0fa836a6aa1ac116653e7d3a03f6b066","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        \"\"\""},{"line_number":172,"context_line":"        vf_index \u003d self.pci_slot_map.get(pci_slot)"},{"line_number":173,"context_line":"        if vf_index is None:"},{"line_number":174,"context_line":"            LOG.warning(_(\"Cannot find vf index for pci slot %s\"),"},{"line_number":175,"context_line":"                        pci_slot)"},{"line_number":176,"context_line":"            raise exc.InvalidPciSlotError(pci_slot\u003dpci_slot)"},{"line_number":177,"context_line":"        return self.pci_dev_wrapper.set_vf_spoofchk(vf_index, enabled)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_9908562f","line":174,"updated":"2015-06-16 09:47:37.000000000","message":"Is the warning really necessary if you\u0027re throwing an exception right away?","commit_id":"bfe0330a54cb13122889670f17b5db9fa362cddc"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"786ff3ea9593cf88a2fc76c28653df3067f0fb9c","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        \"\"\""},{"line_number":172,"context_line":"        vf_index \u003d self.pci_slot_map.get(pci_slot)"},{"line_number":173,"context_line":"        if vf_index is None:"},{"line_number":174,"context_line":"            LOG.warning(_(\"Cannot find vf index for pci slot %s\"),"},{"line_number":175,"context_line":"                        pci_slot)"},{"line_number":176,"context_line":"            raise exc.InvalidPciSlotError(pci_slot\u003dpci_slot)"},{"line_number":177,"context_line":"        return self.pci_dev_wrapper.set_vf_spoofchk(vf_index, enabled)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_106e5095","line":174,"in_reply_to":"fa32b979_9908562f","updated":"2015-06-16 14:53:57.000000000","message":"I did it following the pattern in the function implemented above (set_device_state). It doesn\u0027t bring much value though, so I\u0027ll drop it.","commit_id":"bfe0330a54cb13122889670f17b5db9fa362cddc"},{"author":{"_account_id":4656,"name":"Sean M. Collins","email":"sean@coreitpro.com","username":"scollins"},"change_message_id":"226a17a8533ea42986d22bbd653a17991e0e8711","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            raise exc.InvalidPciSlotError(pci_slot\u003dpci_slot)"},{"line_number":164,"context_line":"        return self.pci_dev_wrapper.set_vf_state(vf_index, state)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def set_device_spoofchk(self, pci_slot, enabled):"},{"line_number":167,"context_line":"        \"\"\"Set device spoofchecking"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        @param pci_slot: Virtual Function address"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_9f357adb","line":166,"updated":"2015-06-16 19:16:25.000000000","message":"I\u0027d prefer this be spelled out fully - and named set_device_spoofcheck","commit_id":"939798d541ad292928da839f65bcb5833a63a248"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"95a7d583452368b21628955148786c702d6bb3b6","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            raise exc.InvalidPciSlotError(pci_slot\u003dpci_slot)"},{"line_number":164,"context_line":"        return self.pci_dev_wrapper.set_vf_state(vf_index, state)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def set_device_spoofchk(self, pci_slot, enabled):"},{"line_number":167,"context_line":"        \"\"\"Set device spoofchecking"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        @param pci_slot: Virtual Function address"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_c60c84ef","line":166,"in_reply_to":"fa32b979_9f357adb","updated":"2015-06-17 08:26:17.000000000","message":"Done","commit_id":"939798d541ad292928da839f65bcb5833a63a248"},{"author":{"_account_id":4656,"name":"Sean M. Collins","email":"sean@coreitpro.com","username":"scollins"},"change_message_id":"226a17a8533ea42986d22bbd653a17991e0e8711","unresolved":false,"context_lines":[{"line_number":262,"context_line":"            embedded_switch.set_device_state(pci_slot,"},{"line_number":263,"context_line":"                                             admin_state_up)"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def set_device_spoofchk(self, device_mac, pci_slot, enabled):"},{"line_number":266,"context_line":"        \"\"\"Set device spoofchk"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        Sets device spoofchecking (enabled or disabled)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_bf307ee9","line":265,"updated":"2015-06-16 19:16:25.000000000","message":"Ditto","commit_id":"939798d541ad292928da839f65bcb5833a63a248"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"95a7d583452368b21628955148786c702d6bb3b6","unresolved":false,"context_lines":[{"line_number":262,"context_line":"            embedded_switch.set_device_state(pci_slot,"},{"line_number":263,"context_line":"                                             admin_state_up)"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def set_device_spoofchk(self, device_mac, pci_slot, enabled):"},{"line_number":266,"context_line":"        \"\"\"Set device spoofchk"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        Sets device spoofchecking (enabled or disabled)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_660d78e7","line":265,"in_reply_to":"fa32b979_bf307ee9","updated":"2015-06-17 08:26:17.000000000","message":"Done","commit_id":"939798d541ad292928da839f65bcb5833a63a248"},{"author":{"_account_id":4656,"name":"Sean M. Collins","email":"sean@coreitpro.com","username":"scollins"},"change_message_id":"226a17a8533ea42986d22bbd653a17991e0e8711","unresolved":false,"context_lines":[{"line_number":263,"context_line":"                                             admin_state_up)"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def set_device_spoofchk(self, device_mac, pci_slot, enabled):"},{"line_number":266,"context_line":"        \"\"\"Set device spoofchk"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        Sets device spoofchecking (enabled or disabled)"},{"line_number":269,"context_line":"        @param device_mac: device mac"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_5f4e1270","line":266,"updated":"2015-06-16 19:16:25.000000000","message":"Ditto","commit_id":"939798d541ad292928da839f65bcb5833a63a248"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"95a7d583452368b21628955148786c702d6bb3b6","unresolved":false,"context_lines":[{"line_number":263,"context_line":"                                             admin_state_up)"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def set_device_spoofchk(self, device_mac, pci_slot, enabled):"},{"line_number":266,"context_line":"        \"\"\"Set device spoofchk"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        Sets device spoofchecking (enabled or disabled)"},{"line_number":269,"context_line":"        @param device_mac: device mac"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_8612fc07","line":266,"in_reply_to":"fa32b979_5f4e1270","updated":"2015-06-17 08:26:17.000000000","message":"Done","commit_id":"939798d541ad292928da839f65bcb5833a63a248"}],"neutron/plugins/sriovnicagent/pci_lib.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"44cb1adb0fa836a6aa1ac116653e7d3a03f6b066","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            self._execute(\u0027\u0027, \"link\", (\"set\", self.dev_name, \"vf\","},{"line_number":119,"context_line":"                                       str(vf_index), \"spoofchk\", setting))"},{"line_number":120,"context_line":"        except Exception as e:"},{"line_number":121,"context_line":"            LOG.exception(_(\"Failed executing ip command\"))"},{"line_number":122,"context_line":"            raise exc.IpCommandError(dev_name\u003dself.dev_name,"},{"line_number":123,"context_line":"                                     reason\u003dstr(e))"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_5902ce0c","line":121,"updated":"2015-06-16 09:47:37.000000000","message":"similar question here. Is this LOG necessary when you throw another exception with the same exception embedded?","commit_id":"bfe0330a54cb13122889670f17b5db9fa362cddc"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"786ff3ea9593cf88a2fc76c28653df3067f0fb9c","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            self._execute(\u0027\u0027, \"link\", (\"set\", self.dev_name, \"vf\","},{"line_number":119,"context_line":"                                       str(vf_index), \"spoofchk\", setting))"},{"line_number":120,"context_line":"        except Exception as e:"},{"line_number":121,"context_line":"            LOG.exception(_(\"Failed executing ip command\"))"},{"line_number":122,"context_line":"            raise exc.IpCommandError(dev_name\u003dself.dev_name,"},{"line_number":123,"context_line":"                                     reason\u003dstr(e))"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_101c1011","line":121,"in_reply_to":"fa32b979_5902ce0c","updated":"2015-06-16 14:53:57.000000000","message":"Just like in the previous case, I used the same pattern as function above uses. I\u0027ll drop it here as well.","commit_id":"bfe0330a54cb13122889670f17b5db9fa362cddc"},{"author":{"_account_id":4656,"name":"Sean M. Collins","email":"sean@coreitpro.com","username":"scollins"},"change_message_id":"226a17a8533ea42986d22bbd653a17991e0e8711","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            raise exc.IpCommandError(dev_name\u003dself.dev_name,"},{"line_number":106,"context_line":"                                     reason\u003de)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def set_vf_spoofchk(self, vf_index, enabled):"},{"line_number":109,"context_line":"        \"\"\"sets vf spoofchk"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        @param vf_index: vf index"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_1f588a31","line":108,"updated":"2015-06-16 19:16:25.000000000","message":"Ditto","commit_id":"939798d541ad292928da839f65bcb5833a63a248"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"95a7d583452368b21628955148786c702d6bb3b6","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            raise exc.IpCommandError(dev_name\u003dself.dev_name,"},{"line_number":106,"context_line":"                                     reason\u003de)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def set_vf_spoofchk(self, vf_index, enabled):"},{"line_number":109,"context_line":"        \"\"\"sets vf spoofchk"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        @param vf_index: vf index"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_a62e2041","line":108,"in_reply_to":"fa32b979_1f588a31","updated":"2015-06-17 08:26:17.000000000","message":"Done","commit_id":"939798d541ad292928da839f65bcb5833a63a248"},{"author":{"_account_id":4656,"name":"Sean M. Collins","email":"sean@coreitpro.com","username":"scollins"},"change_message_id":"226a17a8533ea42986d22bbd653a17991e0e8711","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                                     reason\u003de)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def set_vf_spoofchk(self, vf_index, enabled):"},{"line_number":109,"context_line":"        \"\"\"sets vf spoofchk"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        @param vf_index: vf index"},{"line_number":112,"context_line":"        @param enabled: True to enable spoof checking,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_3f5b0e30","line":109,"updated":"2015-06-16 19:16:25.000000000","message":"Ditto","commit_id":"939798d541ad292928da839f65bcb5833a63a248"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"95a7d583452368b21628955148786c702d6bb3b6","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                                     reason\u003de)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def set_vf_spoofchk(self, vf_index, enabled):"},{"line_number":109,"context_line":"        \"\"\"sets vf spoofchk"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        @param vf_index: vf index"},{"line_number":112,"context_line":"        @param enabled: True to enable spoof checking,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_c63324aa","line":109,"in_reply_to":"fa32b979_3f5b0e30","updated":"2015-06-17 08:26:17.000000000","message":"Done","commit_id":"939798d541ad292928da839f65bcb5833a63a248"}],"neutron/plugins/sriovnicagent/sriov_nic_agent.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"44cb1adb0fa836a6aa1ac116653e7d3a03f6b066","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                             {\"device\": device, \"spoofchk\": spoofchk})"},{"line_number":179,"context_line":"                except Exception:"},{"line_number":180,"context_line":"                    LOG.exception(_(\"Failed to set device %s state\"), device)"},{"line_number":181,"context_line":"                # not critical, so could continue"},{"line_number":182,"context_line":"            try:"},{"line_number":183,"context_line":"                self.eswitch_mgr.set_device_state(device, pci_slot,"},{"line_number":184,"context_line":"                                                  admin_state_up)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_3907ca1d","line":181,"updated":"2015-06-16 09:47:37.000000000","message":"If this is expected during normal operations, logging Tracebacks is not operator friendly. Please catch the expected exceptions and log single line statements at the appropriate level. Otherwise a single failure here could result in a tracebacks being printed several times.","commit_id":"bfe0330a54cb13122889670f17b5db9fa362cddc"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"786ff3ea9593cf88a2fc76c28653df3067f0fb9c","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                             {\"device\": device, \"spoofchk\": spoofchk})"},{"line_number":179,"context_line":"                except Exception:"},{"line_number":180,"context_line":"                    LOG.exception(_(\"Failed to set device %s state\"), device)"},{"line_number":181,"context_line":"                # not critical, so could continue"},{"line_number":182,"context_line":"            try:"},{"line_number":183,"context_line":"                self.eswitch_mgr.set_device_state(device, pci_slot,"},{"line_number":184,"context_line":"                                                  admin_state_up)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_3074b4fb","line":181,"in_reply_to":"fa32b979_3907ca1d","updated":"2015-06-16 14:53:57.000000000","message":"Done","commit_id":"bfe0330a54cb13122889670f17b5db9fa362cddc"},{"author":{"_account_id":4656,"name":"Sean M. Collins","email":"sean@coreitpro.com","username":"scollins"},"change_message_id":"226a17a8533ea42986d22bbd653a17991e0e8711","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        # If one of the above operations fails \u003d\u003e resync with plugin"},{"line_number":169,"context_line":"        return (resync_a | resync_b)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def treat_device(self, device, pci_slot, admin_state_up, spoofchk\u003dNone):"},{"line_number":172,"context_line":"        if self.eswitch_mgr.device_exists(device, pci_slot):"},{"line_number":173,"context_line":"            if spoofchk is not None:"},{"line_number":174,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_7f51960d","line":171,"updated":"2015-06-16 19:16:25.000000000","message":"Why not False?","commit_id":"939798d541ad292928da839f65bcb5833a63a248"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"95a7d583452368b21628955148786c702d6bb3b6","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        # If one of the above operations fails \u003d\u003e resync with plugin"},{"line_number":169,"context_line":"        return (resync_a | resync_b)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def treat_device(self, device, pci_slot, admin_state_up, spoofchk\u003dNone):"},{"line_number":172,"context_line":"        if self.eswitch_mgr.device_exists(device, pci_slot):"},{"line_number":173,"context_line":"            if spoofchk is not None:"},{"line_number":174,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_26753063","line":171,"in_reply_to":"fa32b979_7f51960d","updated":"2015-06-17 08:26:17.000000000","message":"I\u0027ve changed that to True actually, because by default more secure is better than less secure I guess.","commit_id":"939798d541ad292928da839f65bcb5833a63a248"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e8c9cb72719731c84c082d57c35f80de5d5e36ec","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                try:"},{"line_number":175,"context_line":"                    self.eswitch_mgr.set_device_spoofchk(device, pci_slot,"},{"line_number":176,"context_line":"                                                         spoofchk)"},{"line_number":177,"context_line":"                    LOG.info(_(\"Device %(device)s spoofchk %(spoofchk)s\"),"},{"line_number":178,"context_line":"                             {\"device\": device, \"spoofchk\": spoofchk})"},{"line_number":179,"context_line":"                except Exception:"},{"line_number":180,"context_line":"                    LOG.warning(_LW(\"Failed to set spoofchk for device %s\"),"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_920e1ae4","line":177,"updated":"2015-06-21 10:46:04.000000000","message":"missing the _LI log hint","commit_id":"a62231124b45b4d469f0f87fa24961c9f02abf52"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"bd02b0384cefa50a478fb2059fe17145e1fe4602","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                try:"},{"line_number":175,"context_line":"                    self.eswitch_mgr.set_device_spoofchk(device, pci_slot,"},{"line_number":176,"context_line":"                                                         spoofchk)"},{"line_number":177,"context_line":"                    LOG.info(_(\"Device %(device)s spoofchk %(spoofchk)s\"),"},{"line_number":178,"context_line":"                             {\"device\": device, \"spoofchk\": spoofchk})"},{"line_number":179,"context_line":"                except Exception:"},{"line_number":180,"context_line":"                    LOG.warning(_LW(\"Failed to set spoofchk for device %s\"),"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_c03608b4","line":177,"in_reply_to":"fa32b979_920e1ae4","updated":"2015-06-21 16:49:49.000000000","message":"Done","commit_id":"a62231124b45b4d469f0f87fa24961c9f02abf52"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"130a888aff23a062be5845ca4ffeeebb1473a0cb","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            try:"},{"line_number":174,"context_line":"                self.eswitch_mgr.set_device_spoofcheck(device, pci_slot,"},{"line_number":175,"context_line":"                                                       spoofcheck)"},{"line_number":176,"context_line":"                LOG.info(_LI(\"Device %(device)s spoofcheck %(spoofcheck)s\"),"},{"line_number":177,"context_line":"                         {\"device\": device, \"spoofcheck\": spoofcheck})"},{"line_number":178,"context_line":"            except Exception:"},{"line_number":179,"context_line":"                LOG.warning(_LW(\"Failed to set spoofcheck for device %s\"),"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_de5041d7","line":176,"updated":"2015-06-26 11:20:05.000000000","message":"how about moving line 176-177 after line 181. They don\u0027t belong in the try block. Another reason is that if the operation fails you have 2 logs entry for the same operation (line 176 and then line 179)","commit_id":"cf58feb816850d329c62dd03be754533c4fa07aa"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"7c42eeeb9fcadf68e53d7c7618424d54e66e1ba6","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            try:"},{"line_number":174,"context_line":"                self.eswitch_mgr.set_device_spoofcheck(device, pci_slot,"},{"line_number":175,"context_line":"                                                       spoofcheck)"},{"line_number":176,"context_line":"                LOG.info(_LI(\"Device %(device)s spoofcheck %(spoofcheck)s\"),"},{"line_number":177,"context_line":"                         {\"device\": device, \"spoofcheck\": spoofcheck})"},{"line_number":178,"context_line":"            except Exception:"},{"line_number":179,"context_line":"                LOG.warning(_LW(\"Failed to set spoofcheck for device %s\"),"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_844b465f","line":176,"in_reply_to":"fa32b979_de5041d7","updated":"2015-06-26 12:06:27.000000000","message":"Done","commit_id":"cf58feb816850d329c62dd03be754533c4fa07aa"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"130a888aff23a062be5845ca4ffeeebb1473a0cb","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            except Exception:"},{"line_number":179,"context_line":"                LOG.warning(_LW(\"Failed to set spoofcheck for device %s\"),"},{"line_number":180,"context_line":"                            device)"},{"line_number":181,"context_line":"            # not critical, so could continue"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"            try:"},{"line_number":184,"context_line":"                self.eswitch_mgr.set_device_state(device, pci_slot,"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_be6a1d80","line":181,"updated":"2015-06-26 11:20:05.000000000","message":"I\u0027d remove this comment, it\u0027s obvious from the code, if you catch en exception and don\u0027t throw it again it\u0027s not critical","commit_id":"cf58feb816850d329c62dd03be754533c4fa07aa"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"7c42eeeb9fcadf68e53d7c7618424d54e66e1ba6","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            except Exception:"},{"line_number":179,"context_line":"                LOG.warning(_LW(\"Failed to set spoofcheck for device %s\"),"},{"line_number":180,"context_line":"                            device)"},{"line_number":181,"context_line":"            # not critical, so could continue"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"            try:"},{"line_number":184,"context_line":"                self.eswitch_mgr.set_device_state(device, pci_slot,"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_645ac22c","line":181,"in_reply_to":"fa32b979_be6a1d80","updated":"2015-06-26 12:06:27.000000000","message":"Done","commit_id":"cf58feb816850d329c62dd03be754533c4fa07aa"}],"neutron/tests/unit/plugins/sriovnicagent/test_eswitch_manager.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"44cb1adb0fa836a6aa1ac116653e7d3a03f6b066","unresolved":false,"context_lines":[{"line_number":242,"context_line":"    def test_set_device_spoofchk_ok(self):"},{"line_number":243,"context_line":"        with mock.patch(\"neutron.plugins.sriovnicagent.pci_lib.\""},{"line_number":244,"context_line":"                        \"PciDeviceIPWrapper.set_vf_spoofchk\"):"},{"line_number":245,"context_line":"            with mock.patch(\"neutron.plugins.sriovnicagent.pci_lib.LOG.\""},{"line_number":246,"context_line":"                            \"warning\") as log_mock:"},{"line_number":247,"context_line":"                self.emb_switch.set_device_spoofchk(self.PCI_SLOT, True)"},{"line_number":248,"context_line":"                self.assertEqual(0, log_mock.call_count)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_790d523d","line":245,"updated":"2015-06-16 09:47:37.000000000","message":"this test is to make sure its okay, not that it doesn\u0027t call a particular logging facility. set_device_spoofchk raises if it has an issue so you can skip the LOG mock and just call the method to make sure it doesn\u0027t raise.","commit_id":"bfe0330a54cb13122889670f17b5db9fa362cddc"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"786ff3ea9593cf88a2fc76c28653df3067f0fb9c","unresolved":false,"context_lines":[{"line_number":242,"context_line":"    def test_set_device_spoofchk_ok(self):"},{"line_number":243,"context_line":"        with mock.patch(\"neutron.plugins.sriovnicagent.pci_lib.\""},{"line_number":244,"context_line":"                        \"PciDeviceIPWrapper.set_vf_spoofchk\"):"},{"line_number":245,"context_line":"            with mock.patch(\"neutron.plugins.sriovnicagent.pci_lib.LOG.\""},{"line_number":246,"context_line":"                            \"warning\") as log_mock:"},{"line_number":247,"context_line":"                self.emb_switch.set_device_spoofchk(self.PCI_SLOT, True)"},{"line_number":248,"context_line":"                self.assertEqual(0, log_mock.call_count)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_02483b5a","line":245,"in_reply_to":"fa32b979_790d523d","updated":"2015-06-16 14:53:57.000000000","message":"Done","commit_id":"bfe0330a54cb13122889670f17b5db9fa362cddc"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"130a888aff23a062be5845ca4ffeeebb1473a0cb","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                        \"PciDeviceIPWrapper.set_vf_spoofcheck\") as \\"},{"line_number":245,"context_line":"                                set_vf_spoofcheck_mock:"},{"line_number":246,"context_line":"            self.emb_switch.set_device_spoofcheck(self.PCI_SLOT, True)"},{"line_number":247,"context_line":"            self.assertEqual(1, set_vf_spoofcheck_mock.call_count)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def test_set_device_spoofcheck_fail(self):"},{"line_number":250,"context_line":"        with mock.patch(\"neutron.plugins.sriovnicagent.pci_lib.\""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_9e9e39b7","line":247,"updated":"2015-06-26 11:20:05.000000000","message":"or more simply\nself.assertTrue(set_vf_spoofcheck_mock.called)","commit_id":"cf58feb816850d329c62dd03be754533c4fa07aa"},{"author":{"_account_id":6509,"name":"Roman Bogorodskiy","email":"rbogorodskiy@mirantis.com","username":"novel"},"change_message_id":"7c42eeeb9fcadf68e53d7c7618424d54e66e1ba6","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                        \"PciDeviceIPWrapper.set_vf_spoofcheck\") as \\"},{"line_number":245,"context_line":"                                set_vf_spoofcheck_mock:"},{"line_number":246,"context_line":"            self.emb_switch.set_device_spoofcheck(self.PCI_SLOT, True)"},{"line_number":247,"context_line":"            self.assertEqual(1, set_vf_spoofcheck_mock.call_count)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def test_set_device_spoofcheck_fail(self):"},{"line_number":250,"context_line":"        with mock.patch(\"neutron.plugins.sriovnicagent.pci_lib.\""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_848d862c","line":247,"in_reply_to":"fa32b979_9e9e39b7","updated":"2015-06-26 12:06:27.000000000","message":"Done","commit_id":"cf58feb816850d329c62dd03be754533c4fa07aa"}]}
