)]}'
{"CONTRIBUTING.rst":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"9df835fd001ba0fd66193e6b57dbbb5300438e04","unresolved":false,"context_lines":[{"line_number":341,"context_line":"The contract between **inspector** and a PXE filter driver is described in the"},{"line_number":342,"context_line":":class:`FilterDriver` interface. The methods a driver has to implement are:"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":"* :meth:`~FilterDriver.__init__` called by ``stevedore`` on filter driver"},{"line_number":345,"context_line":"  module load to e.g parse driver configuration"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"* :meth:`~FilterDriver.init_filter` called on the service start to initialize"}],"source_content_type":"text/x-rst","patch_set":17,"id":"df140735_c9715478","line":344,"updated":"2017-06-05 10:15:18.000000000","message":"this link does not render","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"f921f69613e64324a176ae28dd402388c3c7b176","unresolved":false,"context_lines":[{"line_number":341,"context_line":"The contract between **inspector** and a PXE filter driver is described in the"},{"line_number":342,"context_line":":class:`FilterDriver` interface. The methods a driver has to implement are:"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":"* :meth:`~FilterDriver.__init__` called by ``stevedore`` on filter driver"},{"line_number":345,"context_line":"  module load to e.g parse driver configuration"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"* :meth:`~FilterDriver.init_filter` called on the service start to initialize"}],"source_content_type":"text/x-rst","patch_set":17,"id":"df140735_f365221f","line":344,"in_reply_to":"df140735_c9715478","updated":"2017-06-05 15:40:47.000000000","message":"Done","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"773c6224368de6ca334e1941da7ac239864ff4c8","unresolved":false,"context_lines":[{"line_number":358,"context_line":":class:`BaseFilter` that provides base locking and initialization"},{"line_number":359,"context_line":"implementation. A subclass has to provide a custom ``sync`` method. If"},{"line_number":360,"context_line":"required, a driver can opt-out from the periodic synchronization by overriding"},{"line_number":361,"context_line":"the :meth:`~FilterDriver.get_periodic_sync_task`."}],"source_content_type":"text/x-rst","patch_set":19,"id":"df140735_c120b19e","line":361,"range":{"start_line":361,"start_character":12,"end_line":361,"end_character":24},"updated":"2017-06-07 15:47:28.000000000","message":"Oops, wrong class O:-)","commit_id":"9037885b432b7480a2a9d8821f1657debb94ef3a"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"d26029349f1fe96b781e13e26fd4ace3b680d415","unresolved":false,"context_lines":[{"line_number":358,"context_line":":class:`BaseFilter` that provides base locking and initialization"},{"line_number":359,"context_line":"implementation. A subclass has to provide a custom ``sync`` method. If"},{"line_number":360,"context_line":"required, a driver can opt-out from the periodic synchronization by overriding"},{"line_number":361,"context_line":"the :meth:`~FilterDriver.get_periodic_sync_task`."}],"source_content_type":"text/x-rst","patch_set":20,"id":"7f231b9d_8e666fed","line":361,"range":{"start_line":361,"start_character":4,"end_line":361,"end_character":47},"updated":"2017-06-12 09:30:16.000000000","message":"link doesn\u0027t clickable","commit_id":"dab7c65f83945501fdd695ab25d07ece42d92f5d"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"123fc41dd5727740232d467c55e0b2e6f3fdd02e","unresolved":false,"context_lines":[{"line_number":358,"context_line":":class:`BaseFilter` that provides base locking and initialization"},{"line_number":359,"context_line":"implementation. A subclass has to provide a custom ``sync`` method. If"},{"line_number":360,"context_line":"required, a driver can opt-out from the periodic synchronization by overriding"},{"line_number":361,"context_line":"the :meth:`~FilterDriver.get_periodic_sync_task`."}],"source_content_type":"text/x-rst","patch_set":20,"id":"7f231b9d_011a2d7c","line":361,"range":{"start_line":361,"start_character":4,"end_line":361,"end_character":47},"in_reply_to":"7f231b9d_8e666fed","updated":"2017-06-12 12:23:23.000000000","message":"Oops!","commit_id":"dab7c65f83945501fdd695ab25d07ece42d92f5d"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"d8a53c11ffe095e2f88bf5513571e93266a0f15f","unresolved":false,"context_lines":[{"line_number":323,"context_line":"Background"},{"line_number":324,"context_line":"----------"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"In-band node introspection PXE-boots a \"live\" image, the IPA, to inspect the"},{"line_number":327,"context_line":"node hardware. **ironic** PXE-boots IPA to, besides other tasks, deploy tenant"},{"line_number":328,"context_line":"images on a node. Because of **neutron** not allowing an unknown MAC address to"},{"line_number":329,"context_line":"boot, **inspector** has to rely on a custom DHCP/TFTP stack."},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"To prevent DHCP collisions between the node in-band introspection and the"},{"line_number":332,"context_line":"deployment of nodes, **inspector** has to limit or filter the DHCP leases to"},{"line_number":333,"context_line":"only allow nodes being discovered (unknown MAC address) or inspected to receive"},{"line_number":334,"context_line":"a lease."},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"Filter Interface"},{"line_number":337,"context_line":"----------------"}],"source_content_type":"text/x-rst","patch_set":26,"id":"5f201791_f35ad080","line":334,"range":{"start_line":326,"start_character":0,"end_line":334,"end_character":8},"updated":"2017-06-27 12:45:51.000000000","message":"**inspector** in-band introspection PXE-boots the Ironic Python Agent \"live\" image, to inspect the baremetal server.\n\n**ironic** also PXE-boots IPA to perform tasks on a node, such as deploying an image.\n\n**ironic** uses **neutron** to provide DHCP, however **neutron** does not provide DHCP for unknown MAC addresses so **inspector** has to use its own DHCP/TFTP stack for discovery and inspection.\n\nWhen **ironic** and **inspector** are operating in the same L2 network, there is a potential for the two DHCPs to race, which could result in a node being deployed by Ironic being PXE booted by **inspector**.  \n\nTo prevent DHCP races between the **inspector** DHCP and **ironic** DHCP, **inspector** has to be able filter which nodes can get a DHCP lease from the **inspector** DHCP server. These filters can then be used to prevent node\u0027s enrolled in Ironic\u0027s inventory from being PXE-booted unless they are explicitly moved into the inspected state.","commit_id":"a0ba76a20226372f084a12153061e26d155af8df"}],"example.conf":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"31505c3cef38696b3a69565ba5024f3e1aff37bc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"bff0334d_61200d9c","updated":"2017-04-12 12:18:54.000000000","message":"this file needs regenerating","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"78c7d5279d2a0bbe170a648fd103430106a9bf46","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"9ff52f3f_b2c64116","in_reply_to":"bff0334d_61200d9c","updated":"2017-04-13 10:32:38.000000000","message":"Ouch, forgotten to O:-) will do.","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"}],"ironic_inspector/conf.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"31505c3cef38696b3a69565ba5024f3e1aff37bc","unresolved":false,"context_lines":[{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"PXE_FILTER_OPTS \u003d ["},{"line_number":199,"context_line":"    cfg.StrOpt(\u0027driver_name\u0027, default\u003d\u0027iptables\u0027,"},{"line_number":200,"context_line":"               help\u003d_(\u0027PXE boot filter driver to use, such as iptables\u0027)),"},{"line_number":201,"context_line":"    cfg.IntOpt(\u0027portlist_paginate\u0027, default\u003d1000,"},{"line_number":202,"context_line":"               help\u003d_(\u0027The pagination limit for polling ironic port list\u0027)),"}],"source_content_type":"text/x-python","patch_set":6,"id":"bff0334d_410aa91f","line":199,"updated":"2017-04-12 12:18:54.000000000","message":"nit: I\u0027d shorten it to just \"driver\"","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"78c7d5279d2a0bbe170a648fd103430106a9bf46","unresolved":false,"context_lines":[{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"PXE_FILTER_OPTS \u003d ["},{"line_number":199,"context_line":"    cfg.StrOpt(\u0027driver_name\u0027, default\u003d\u0027iptables\u0027,"},{"line_number":200,"context_line":"               help\u003d_(\u0027PXE boot filter driver to use, such as iptables\u0027)),"},{"line_number":201,"context_line":"    cfg.IntOpt(\u0027portlist_paginate\u0027, default\u003d1000,"},{"line_number":202,"context_line":"               help\u003d_(\u0027The pagination limit for polling ironic port list\u0027)),"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_7282f9ca","line":199,"in_reply_to":"bff0334d_410aa91f","updated":"2017-04-13 10:32:38.000000000","message":"makes sense. will do.","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"31505c3cef38696b3a69565ba5024f3e1aff37bc","unresolved":false,"context_lines":[{"line_number":199,"context_line":"    cfg.StrOpt(\u0027driver_name\u0027, default\u003d\u0027iptables\u0027,"},{"line_number":200,"context_line":"               help\u003d_(\u0027PXE boot filter driver to use, such as iptables\u0027)),"},{"line_number":201,"context_line":"    cfg.IntOpt(\u0027portlist_paginate\u0027, default\u003d1000,"},{"line_number":202,"context_line":"               help\u003d_(\u0027The pagination limit for polling ironic port list\u0027)),"},{"line_number":203,"context_line":"    cfg.IntOpt(\u0027sync_period\u0027, default\u003d15,"},{"line_number":204,"context_line":"               deprecated_name\u003d\u0027firewall_update_period\u0027,"},{"line_number":205,"context_line":"               deprecated_group\u003d\u0027firewall\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"bff0334d_21156540","line":202,"updated":"2017-04-12 12:18:54.000000000","message":"this does not seem to belong here","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"78c7d5279d2a0bbe170a648fd103430106a9bf46","unresolved":false,"context_lines":[{"line_number":199,"context_line":"    cfg.StrOpt(\u0027driver_name\u0027, default\u003d\u0027iptables\u0027,"},{"line_number":200,"context_line":"               help\u003d_(\u0027PXE boot filter driver to use, such as iptables\u0027)),"},{"line_number":201,"context_line":"    cfg.IntOpt(\u0027portlist_paginate\u0027, default\u003d1000,"},{"line_number":202,"context_line":"               help\u003d_(\u0027The pagination limit for polling ironic port list\u0027)),"},{"line_number":203,"context_line":"    cfg.IntOpt(\u0027sync_period\u0027, default\u003d15,"},{"line_number":204,"context_line":"               deprecated_name\u003d\u0027firewall_update_period\u0027,"},{"line_number":205,"context_line":"               deprecated_group\u003d\u0027firewall\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_f79ddb66","line":202,"in_reply_to":"bff0334d_21156540","updated":"2017-04-13 10:32:38.000000000","message":"the generic driver.get_blacklist() method uses this value to paginate ironic.port.list. It will be used by those drivers not overriding the driver.get_blacklist method (currently noop \u0026 iptables, dnsmasq in the future) I can rename instead; how about \"blacklist_paginate\"?","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":21909,"name":"Bob Fournier","email":"bfournie@redhat.com","username":"bfournie"},"change_message_id":"aa6a7cab1a4247b8760d2770841cd65fa69ac8a0","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    cfg.ListOpt(\u0027ethoib_interfaces\u0027,"},{"line_number":209,"context_line":"                deprecated_group\u003d\u0027firewall\u0027,"},{"line_number":210,"context_line":"                default\u003d[],"},{"line_number":211,"context_line":"                help\u003d_(\u0027List of Etherent Over InfiniBand interfaces \u0027"},{"line_number":212,"context_line":"                       \u0027on the Inspector host which are used for physical \u0027"},{"line_number":213,"context_line":"                       \u0027access to the DHCP network. Multiple interfaces would \u0027"},{"line_number":214,"context_line":"                       \u0027be attached to a bond or bridge specified in \u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"bff0334d_1dacf69c","line":211,"range":{"start_line":211,"start_character":32,"end_line":211,"end_character":40},"updated":"2017-04-12 19:27:13.000000000","message":"nit - typo \"Etherent\" (I realize this was copied from current)","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"78c7d5279d2a0bbe170a648fd103430106a9bf46","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    cfg.ListOpt(\u0027ethoib_interfaces\u0027,"},{"line_number":209,"context_line":"                deprecated_group\u003d\u0027firewall\u0027,"},{"line_number":210,"context_line":"                default\u003d[],"},{"line_number":211,"context_line":"                help\u003d_(\u0027List of Etherent Over InfiniBand interfaces \u0027"},{"line_number":212,"context_line":"                       \u0027on the Inspector host which are used for physical \u0027"},{"line_number":213,"context_line":"                       \u0027access to the DHCP network. Multiple interfaces would \u0027"},{"line_number":214,"context_line":"                       \u0027be attached to a bond or bridge specified in \u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_326c7135","line":211,"range":{"start_line":211,"start_character":32,"end_line":211,"end_character":40},"in_reply_to":"bff0334d_1dacf69c","updated":"2017-04-13 10:32:38.000000000","message":"will do.","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"04d75fdc76a0ea86d69368f4d6f5929e40651f32","unresolved":false,"context_lines":[{"line_number":209,"context_line":"PXE_FILTER_OPTS \u003d ["},{"line_number":210,"context_line":"    cfg.StrOpt(\u0027driver\u0027, default\u003d\u0027iptables\u0027,"},{"line_number":211,"context_line":"               help\u003d_(\u0027PXE boot filter driver to use, such as iptables\u0027)),"},{"line_number":212,"context_line":"    cfg.IntOpt(\u0027sync_period\u0027, default\u003d15,"},{"line_number":213,"context_line":"               deprecated_name\u003d\u0027firewall_update_period\u0027,"},{"line_number":214,"context_line":"               deprecated_group\u003d\u0027firewall\u0027,"},{"line_number":215,"context_line":"               help\u003d_(\u0027Amount of time in seconds, after which repeat periodic \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_2dd8291c","line":212,"range":{"start_line":212,"start_character":0,"end_line":212,"end_character":41},"updated":"2017-05-22 12:48:28.000000000","message":"nit: I guess we could limit by min\u003d0","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"a5cbc12ff444bd94dbca2dad7c1996d8dfad3c2e","unresolved":false,"context_lines":[{"line_number":209,"context_line":"PXE_FILTER_OPTS \u003d ["},{"line_number":210,"context_line":"    cfg.StrOpt(\u0027driver\u0027, default\u003d\u0027iptables\u0027,"},{"line_number":211,"context_line":"               help\u003d_(\u0027PXE boot filter driver to use, such as iptables\u0027)),"},{"line_number":212,"context_line":"    cfg.IntOpt(\u0027sync_period\u0027, default\u003d15,"},{"line_number":213,"context_line":"               deprecated_name\u003d\u0027firewall_update_period\u0027,"},{"line_number":214,"context_line":"               deprecated_group\u003d\u0027firewall\u0027,"},{"line_number":215,"context_line":"               help\u003d_(\u0027Amount of time in seconds, after which repeat periodic \u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_edc5ff5c","line":212,"range":{"start_line":212,"start_character":0,"end_line":212,"end_character":41},"in_reply_to":"ff0f0b1f_2dd8291c","updated":"2017-05-29 10:03:00.000000000","message":"Done","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"9df835fd001ba0fd66193e6b57dbbb5300438e04","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                default\u003dTrue,"},{"line_number":32,"context_line":"                deprecated_for_removal\u003dTrue,"},{"line_number":33,"context_line":"                deprecated_group\u003d\u0027firewall\u0027,"},{"line_number":34,"context_line":"                help\u003d_(\u0027Whether to manage firewall rules for PXE port.\u0027)),"},{"line_number":35,"context_line":"    cfg.StrOpt(\u0027dnsmasq_interface\u0027,"},{"line_number":36,"context_line":"               default\u003d\u0027br-ctlplane\u0027,"},{"line_number":37,"context_line":"               deprecated_group\u003d\u0027firewall\u0027,"}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_a90180b1","line":34,"updated":"2017-06-05 10:15:18.000000000","message":"I\u0027d like a note on why it\u0027s deprecated","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"f921f69613e64324a176ae28dd402388c3c7b176","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                default\u003dTrue,"},{"line_number":32,"context_line":"                deprecated_for_removal\u003dTrue,"},{"line_number":33,"context_line":"                deprecated_group\u003d\u0027firewall\u0027,"},{"line_number":34,"context_line":"                help\u003d_(\u0027Whether to manage firewall rules for PXE port.\u0027)),"},{"line_number":35,"context_line":"    cfg.StrOpt(\u0027dnsmasq_interface\u0027,"},{"line_number":36,"context_line":"               default\u003d\u0027br-ctlplane\u0027,"},{"line_number":37,"context_line":"               deprecated_group\u003d\u0027firewall\u0027,"}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_0e44e945","line":34,"in_reply_to":"df140735_a90180b1","updated":"2017-06-05 15:40:47.000000000","message":"Done","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"9df835fd001ba0fd66193e6b57dbbb5300438e04","unresolved":false,"context_lines":[{"line_number":196,"context_line":"                      \u0027running commands as root\u0027)),"},{"line_number":197,"context_line":"    cfg.IntOpt(\u0027api_max_limit\u0027, default\u003d1000, min\u003d1,"},{"line_number":198,"context_line":"               help\u003d_(\u0027Limit the number of elements an API list-call \u0027"},{"line_number":199,"context_line":"                      \u0027returns\u0027)),"},{"line_number":200,"context_line":"]"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_89fc7cb5","line":199,"updated":"2017-06-05 10:15:18.000000000","message":"nit: unrelated change?","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"f921f69613e64324a176ae28dd402388c3c7b176","unresolved":false,"context_lines":[{"line_number":196,"context_line":"                      \u0027running commands as root\u0027)),"},{"line_number":197,"context_line":"    cfg.IntOpt(\u0027api_max_limit\u0027, default\u003d1000, min\u003d1,"},{"line_number":198,"context_line":"               help\u003d_(\u0027Limit the number of elements an API list-call \u0027"},{"line_number":199,"context_line":"                      \u0027returns\u0027)),"},{"line_number":200,"context_line":"]"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_ee39b5a3","line":199,"in_reply_to":"df140735_89fc7cb5","updated":"2017-06-05 15:40:47.000000000","message":"Done","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"}],"ironic_inspector/firewall.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"31505c3cef38696b3a69565ba5024f3e1aff37bc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"bff0334d_0110214d","updated":"2017-04-12 12:18:54.000000000","message":"this should move to ironic_inspector.plugins now that it\u0027s just a plugin. or maybe ironic_inspector.pxe_filter.iptables?","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"78c7d5279d2a0bbe170a648fd103430106a9bf46","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"9ff52f3f_b7dcf318","in_reply_to":"bff0334d_0110214d","updated":"2017-04-13 10:32:38.000000000","message":"I prefer new module but yeah, seems logical","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"a3dc0ab58cdc237bdca9727073941509971ca656","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"CONF \u003d cfg.CONF"},{"line_number":27,"context_line":"LOG \u003d log.getLogger(\"ironic_inspector.iptables\")"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def _should_enable_dhcp():"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_5e270466","line":27,"range":{"start_line":27,"start_character":38,"end_line":27,"end_character":46},"updated":"2017-04-13 09:50:35.000000000","message":"It\u0027s confusing, file name is `firewall`.\n\nWhat about reorganizing file structure? Add new dir with pxe filters.","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"78c7d5279d2a0bbe170a648fd103430106a9bf46","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"CONF \u003d cfg.CONF"},{"line_number":27,"context_line":"LOG \u003d log.getLogger(\"ironic_inspector.iptables\")"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def _should_enable_dhcp():"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_b213e1b8","line":27,"range":{"start_line":27,"start_character":38,"end_line":27,"end_character":46},"in_reply_to":"9ff52f3f_5e270466","updated":"2017-04-13 10:32:38.000000000","message":"yup, will do; Dmitry suggested the same and I really like the idea.","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"31505c3cef38696b3a69565ba5024f3e1aff37bc","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            CONF.processing.node_not_found_hook is not None)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class FilterDriver(pxe_filter.FilterDriver):"},{"line_number":41,"context_line":"    \"\"\"A PXE boot filtering interface implementation.\"\"\""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def __init__(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"bff0334d_e11add6c","line":40,"updated":"2017-04-12 12:18:54.000000000","message":"let\u0027s call it IptablesFilter for clarity?","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"31505c3cef38696b3a69565ba5024f3e1aff37bc","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        self._iptables(\u0027-X\u0027, main_chain, ignore\u003dTrue)"},{"line_number":159,"context_line":"        self._iptables(\u0027-E\u0027, chain, main_chain)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def _iptables(self, *args, **kwargs):"},{"line_number":162,"context_line":"        # NOTE(dtantsur): -w flag makes it wait for xtables lock"},{"line_number":163,"context_line":"        cmd \u003d self.base_command + args"},{"line_number":164,"context_line":"        ignore \u003d kwargs.pop(\u0027ignore\u0027, False)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bff0334d_c115993e","line":161,"updated":"2017-04-12 12:18:54.000000000","message":"I wonder if we should move this to utils.py..","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":21909,"name":"Bob Fournier","email":"bfournie@redhat.com","username":"bfournie"},"change_message_id":"aa6a7cab1a4247b8760d2770841cd65fa69ac8a0","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                raise"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    def _clean_up(self, chain):"},{"line_number":180,"context_line":"        self._iptables(\u0027-D\u0027, \u0027INPUT\u0027, \u0027-i\u0027, self.interface, \u0027-p\u0027, \u0027udp\u0027,"},{"line_number":181,"context_line":"                       \u0027--dport\u0027, \u002767\u0027, \u0027-j\u0027, chain,"},{"line_number":182,"context_line":"                       ignore\u003dTrue)"},{"line_number":183,"context_line":"        self._iptables(\u0027-F\u0027, chain, ignore\u003dTrue)"},{"line_number":184,"context_line":"        self._iptables(\u0027-X\u0027, chain, ignore\u003dTrue)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bff0334d_00e92de4","line":182,"range":{"start_line":180,"start_character":8,"end_line":182,"end_character":35},"updated":"2017-04-12 19:27:13.000000000","message":"Since the next command will flush all rules, this command isn\u0027t necessary.","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"}],"ironic_inspector/introspect.py":[{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"36857962de70410aba51ee14cee8640ad0cca7f0","unresolved":false,"context_lines":[{"line_number":219,"context_line":"    try:"},{"line_number":220,"context_line":"        pxe_filter.driver_manager().driver.sync(ironic)"},{"line_number":221,"context_line":"    except Exception as exc:"},{"line_number":222,"context_line":"        # Note(mkovacik): this will be retried in the PXE filter_update"},{"line_number":223,"context_line":"        # periodic task; we continue aborting"},{"line_number":224,"context_line":"        LOG.warning(\u0027Failed to update PXE filter: %s\u0027, exc,"},{"line_number":225,"context_line":"                    node_info\u003dnode_info)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_76bbc2c3","line":222,"range":{"start_line":222,"start_character":58,"end_line":222,"end_character":71},"updated":"2017-05-19 13:44:07.000000000","message":"Oops, should read: PXE filter sync","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"a5cbc12ff444bd94dbca2dad7c1996d8dfad3c2e","unresolved":false,"context_lines":[{"line_number":219,"context_line":"    try:"},{"line_number":220,"context_line":"        pxe_filter.driver_manager().driver.sync(ironic)"},{"line_number":221,"context_line":"    except Exception as exc:"},{"line_number":222,"context_line":"        # Note(mkovacik): this will be retried in the PXE filter_update"},{"line_number":223,"context_line":"        # periodic task; we continue aborting"},{"line_number":224,"context_line":"        LOG.warning(\u0027Failed to update PXE filter: %s\u0027, exc,"},{"line_number":225,"context_line":"                    node_info\u003dnode_info)"}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_4d3e2b2a","line":222,"range":{"start_line":222,"start_character":58,"end_line":222,"end_character":71},"in_reply_to":"ff0f0b1f_76bbc2c3","updated":"2017-05-29 10:03:00.000000000","message":"Done","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"36857962de70410aba51ee14cee8640ad0cca7f0","unresolved":false,"context_lines":[{"line_number":221,"context_line":"    except Exception as exc:"},{"line_number":222,"context_line":"        # Note(mkovacik): this will be retried in the PXE filter_update"},{"line_number":223,"context_line":"        # periodic task; we continue aborting"},{"line_number":224,"context_line":"        LOG.warning(\u0027Failed to update PXE filter: %s\u0027, exc,"},{"line_number":225,"context_line":"                    node_info\u003dnode_info)"},{"line_number":226,"context_line":"    LOG.info(\u0027Introspection aborted\u0027, node_info\u003dnode_info)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_36eaeaab","line":224,"range":{"start_line":224,"start_character":31,"end_line":224,"end_character":37},"updated":"2017-05-19 13:44:07.000000000","message":"ditto","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"a5cbc12ff444bd94dbca2dad7c1996d8dfad3c2e","unresolved":false,"context_lines":[{"line_number":221,"context_line":"    except Exception as exc:"},{"line_number":222,"context_line":"        # Note(mkovacik): this will be retried in the PXE filter_update"},{"line_number":223,"context_line":"        # periodic task; we continue aborting"},{"line_number":224,"context_line":"        LOG.warning(\u0027Failed to update PXE filter: %s\u0027, exc,"},{"line_number":225,"context_line":"                    node_info\u003dnode_info)"},{"line_number":226,"context_line":"    LOG.info(\u0027Introspection aborted\u0027, node_info\u003dnode_info)"}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_0d2153fc","line":224,"range":{"start_line":224,"start_character":31,"end_line":224,"end_character":37},"in_reply_to":"ff0f0b1f_36eaeaab","updated":"2017-05-29 10:03:00.000000000","message":"Done","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"}],"ironic_inspector/pxe_filter.py":[{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"6af298f031653577c90dd5a098a0492709ef0420","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    \"\"\"The PXE boot filtering interface.\"\"\""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    @abc.abstractproperty"},{"line_number":34,"context_line":"    def update_period(self):"},{"line_number":35,"context_line":"        \"\"\"A period between consecutive update_filter calls."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"        :returns: a positive number or None; None disables"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba2be162_819c8cc1","line":34,"range":{"start_line":34,"start_character":8,"end_line":34,"end_character":21},"updated":"2017-03-02 10:33:36.000000000","message":"why did you make update_period driver specific?\nit\u0027s more related to inspector-ironic sync","commit_id":"b36f828698195e10bed94b5afbc167f652b8e04c"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"75e05ae3d1ab144bc209bf245f5cde793c537052","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    \"\"\"The PXE boot filtering interface.\"\"\""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    @abc.abstractproperty"},{"line_number":34,"context_line":"    def update_period(self):"},{"line_number":35,"context_line":"        \"\"\"A period between consecutive update_filter calls."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"        :returns: a positive number or None; None disables"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba2be162_4d8c7b35","line":34,"range":{"start_line":34,"start_character":8,"end_line":34,"end_character":21},"in_reply_to":"ba2be162_819c8cc1","updated":"2017-03-02 14:06:02.000000000","message":"we\u0027ve got the firewall_update_period a config option of iptables.\nI thought that filters might have their own preference/config on the update period  or maybe don\u0027t need regular sync at all.","commit_id":"b36f828698195e10bed94b5afbc167f652b8e04c"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"6af298f031653577c90dd5a098a0492709ef0420","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        \"\"\""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    @abc.abstractmethod"},{"line_number":51,"context_line":"    def update_filter(self, ironic\u003dNone):"},{"line_number":52,"context_line":"        \"\"\"Update the filter according to node cache."},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        This method is called both periodically and on an as-needed basis."}],"source_content_type":"text/x-python","patch_set":1,"id":"ba2be162_867ae2ef","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":21},"updated":"2017-03-02 10:33:36.000000000","message":"wondering if we should update only particular nodes here","commit_id":"b36f828698195e10bed94b5afbc167f652b8e04c"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"75e05ae3d1ab144bc209bf245f5cde793c537052","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        \"\"\""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    @abc.abstractmethod"},{"line_number":51,"context_line":"    def update_filter(self, ironic\u003dNone):"},{"line_number":52,"context_line":"        \"\"\"Update the filter according to node cache."},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        This method is called both periodically and on an as-needed basis."}],"source_content_type":"text/x-python","patch_set":1,"id":"ba2be162_1848ff5a","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":21},"in_reply_to":"ba2be162_867ae2ef","updated":"2017-03-02 14:06:02.000000000","message":"We\u0027d have to calculate a diff on the behalf of the driver.\nBut should the info passed on to the driver be a node_info instance or a MAC address? What about the noop driver?\n\nOn the other hand, I see that nearly all the drivers would calculate the same diff and duplicate the code to do that.","commit_id":"b36f828698195e10bed94b5afbc167f652b8e04c"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"6af298f031653577c90dd5a098a0492709ef0420","unresolved":false,"context_lines":[{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    if _DRIVER_MANAGER is None:"},{"line_number":103,"context_line":"        _DRIVER_MANAGER \u003d stevedore.driver.DriverManager("},{"line_number":104,"context_line":"            \u0027ironic_inspector.pxe_filter\u0027,"},{"line_number":105,"context_line":"            name\u003dname,"},{"line_number":106,"context_line":"            invoke_on_load\u003dTrue"},{"line_number":107,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba2be162_fb7897c6","line":104,"range":{"start_line":104,"start_character":30,"end_line":104,"end_character":40},"updated":"2017-03-02 10:33:36.000000000","message":"nit: not sure if we should use \u0027pxe\u0027 prefix in base class","commit_id":"b36f828698195e10bed94b5afbc167f652b8e04c"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"75e05ae3d1ab144bc209bf245f5cde793c537052","unresolved":false,"context_lines":[{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    if _DRIVER_MANAGER is None:"},{"line_number":103,"context_line":"        _DRIVER_MANAGER \u003d stevedore.driver.DriverManager("},{"line_number":104,"context_line":"            \u0027ironic_inspector.pxe_filter\u0027,"},{"line_number":105,"context_line":"            name\u003dname,"},{"line_number":106,"context_line":"            invoke_on_load\u003dTrue"},{"line_number":107,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba2be162_cd222b01","line":104,"range":{"start_line":104,"start_character":30,"end_line":104,"end_character":40},"in_reply_to":"ba2be162_fb7897c6","updated":"2017-03-02 14:06:02.000000000","message":"was the shortest string I figured out ;) any concrete suggestion?","commit_id":"b36f828698195e10bed94b5afbc167f652b8e04c"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"31505c3cef38696b3a69565ba5024f3e1aff37bc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"bff0334d_a12a957b","updated":"2017-04-12 12:18:54.000000000","message":"I suggest ironic_inspector.pxe_filter.base, and then add iptables to the same package","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"78c7d5279d2a0bbe170a648fd103430106a9bf46","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"9ff52f3f_b23641b4","in_reply_to":"bff0334d_a12a957b","updated":"2017-04-13 10:32:38.000000000","message":"I like this idea; will do ;)","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"31505c3cef38696b3a69565ba5024f3e1aff37bc","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        \"\"\""},{"line_number":79,"context_line":"        return node_cache.active_macs()"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def get_blacklist(self, ironic\u003dNone, paginate\u003d1000):"},{"line_number":82,"context_line":"        \"\"\"Get the MAC addresses blacklist of nodes not being inspected."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        :param ironic: an optional ironic client instance."}],"source_content_type":"text/x-python","patch_set":6,"id":"bff0334d_812d5196","line":81,"updated":"2017-04-12 12:18:54.000000000","message":"can\u0027t we supply paginate\u003d0 to fetch all ports?","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"2164978c860df5b08a45c228ecae97b32590c41f","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        \"\"\""},{"line_number":79,"context_line":"        return node_cache.active_macs()"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def get_blacklist(self, ironic\u003dNone, paginate\u003d1000):"},{"line_number":82,"context_line":"        \"\"\"Get the MAC addresses blacklist of nodes not being inspected."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        :param ironic: an optional ironic client instance."}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_7012e75a","line":81,"in_reply_to":"9ff52f3f_1477183d","updated":"2017-04-13 19:07:25.000000000","message":"please note that the list is parsed by _imac_to_rmac_mapping   too and let\u0027s just paginate for greater book! :P","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"13d24929f70ae7220eaf0feeaa1ca2573c651058","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        \"\"\""},{"line_number":79,"context_line":"        return node_cache.active_macs()"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def get_blacklist(self, ironic\u003dNone, paginate\u003d1000):"},{"line_number":82,"context_line":"        \"\"\"Get the MAC addresses blacklist of nodes not being inspected."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        :param ironic: an optional ironic client instance."}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_1477183d","line":81,"in_reply_to":"9ff52f3f_6d7d7c6d","updated":"2017-04-13 12:07:21.000000000","message":"API limit is configured on ironic side and ironic client should deal with this. It doesn\u0027t worth to add configuration on inspector side.\n\nalso memory optimization is not our goal now, also I doubt that it worth a shot on this stage.","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"78c7d5279d2a0bbe170a648fd103430106a9bf46","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        \"\"\""},{"line_number":79,"context_line":"        return node_cache.active_macs()"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def get_blacklist(self, ironic\u003dNone, paginate\u003d1000):"},{"line_number":82,"context_line":"        \"\"\"Get the MAC addresses blacklist of nodes not being inspected."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        :param ironic: an optional ironic client instance."}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_6d7d7c6d","line":81,"in_reply_to":"9ff52f3f_9c2fd4f5","updated":"2017-04-13 10:32:38.000000000","message":"it\u0027s rather the batch size as it iterates over all; not sure what a default batch size should be but iirc we\u0027ve got 1000 somewhere already (introspection list?)\n\nTruth is I\u0027m accumulating the ports in a list, optimization might be to yield each port separately (save some resources (memory)) but even now it avoids creating gigantic port mappings w/ the _ib_to_rmac_mapping","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"a3dc0ab58cdc237bdca9727073941509971ca656","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        \"\"\""},{"line_number":79,"context_line":"        return node_cache.active_macs()"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def get_blacklist(self, ironic\u003dNone, paginate\u003d1000):"},{"line_number":82,"context_line":"        \"\"\"Get the MAC addresses blacklist of nodes not being inspected."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        :param ironic: an optional ironic client instance."}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_9c2fd4f5","line":81,"in_reply_to":"bff0334d_812d5196","updated":"2017-04-13 09:50:35.000000000","message":"+1, lets ironic API manages max items per requests, inspector need just all","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":21909,"name":"Bob Fournier","email":"bfournie@redhat.com","username":"bfournie"},"change_message_id":"aa6a7cab1a4247b8760d2770841cd65fa69ac8a0","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        return node_cache.active_macs()"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def get_blacklist(self, ironic\u003dNone, paginate\u003d1000):"},{"line_number":82,"context_line":"        \"\"\"Get the MAC addresses blacklist of nodes not being inspected."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        :param ironic: an optional ironic client instance."},{"line_number":85,"context_line":"        :param paginate: an optional ironic client pagination limit."}],"source_content_type":"text/x-python","patch_set":6,"id":"bff0334d_3307e91a","line":82,"range":{"start_line":82,"start_character":11,"end_line":82,"end_character":72},"updated":"2017-04-12 19:27:13.000000000","message":"Isn\u0027t this really getting the mac address of all nodes, not just the nodes not being inspected?  The macs not being inspected are these macs minus node_cache.active_macs(), no?","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"13d24929f70ae7220eaf0feeaa1ca2573c651058","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        return node_cache.active_macs()"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def get_blacklist(self, ironic\u003dNone, paginate\u003d1000):"},{"line_number":82,"context_line":"        \"\"\"Get the MAC addresses blacklist of nodes not being inspected."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        :param ironic: an optional ironic client instance."},{"line_number":85,"context_line":"        :param paginate: an optional ironic client pagination limit."}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_d42ad0e5","line":82,"range":{"start_line":82,"start_character":11,"end_line":82,"end_character":72},"in_reply_to":"9ff52f3f_cd5fe80c","updated":"2017-04-13 12:07:21.000000000","message":"Yeah, but it\u0027s part of filter api, and it\u0027s called `get_blacklist`, but returns all the ironic ports.","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"2164978c860df5b08a45c228ecae97b32590c41f","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        return node_cache.active_macs()"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def get_blacklist(self, ironic\u003dNone, paginate\u003d1000):"},{"line_number":82,"context_line":"        \"\"\"Get the MAC addresses blacklist of nodes not being inspected."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        :param ironic: an optional ironic client instance."},{"line_number":85,"context_line":"        :param paginate: an optional ironic client pagination limit."}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_1d56142b","line":82,"range":{"start_line":82,"start_character":11,"end_line":82,"end_character":72},"in_reply_to":"9ff52f3f_d42ad0e5","updated":"2017-04-13 19:07:25.000000000","message":"it\u0027s not just about the ironic but also about the _imac_to_rmac_mapping. Mind the return value is a list of MACs for the driver.update_filter() to process as needed","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"78c7d5279d2a0bbe170a648fd103430106a9bf46","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        return node_cache.active_macs()"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def get_blacklist(self, ironic\u003dNone, paginate\u003d1000):"},{"line_number":82,"context_line":"        \"\"\"Get the MAC addresses blacklist of nodes not being inspected."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        :param ironic: an optional ironic client instance."},{"line_number":85,"context_line":"        :param paginate: an optional ironic client pagination limit."}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_cd5fe80c","line":82,"range":{"start_line":82,"start_character":11,"end_line":82,"end_character":72},"in_reply_to":"9ff52f3f_f7fcbb3f","updated":"2017-04-13 10:32:38.000000000","message":"Yes, that other list is the white-list from driver.get_whitelist()\n\nThe main point of this method is to encapsulate ironic.port.list in a generic way. If we e.g decide to cache this data in the future, all drivers (not overriding) will benefit.\n\nIt is still possible for a filter implementation to either override this method or combine the two lists in filter_update() as needed.\n\nFor instance, an optimized iptables filter might want to cache a pool of all blacklist MACs in an ipset and keep a short list of whitelist iptables rules.\n\nAnother usecase might be logging: better off to log the white-list that\u0027s orders of magnitude shorter than the black-list.","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"a3dc0ab58cdc237bdca9727073941509971ca656","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        return node_cache.active_macs()"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def get_blacklist(self, ironic\u003dNone, paginate\u003d1000):"},{"line_number":82,"context_line":"        \"\"\"Get the MAC addresses blacklist of nodes not being inspected."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        :param ironic: an optional ironic client instance."},{"line_number":85,"context_line":"        :param paginate: an optional ironic client pagination limit."}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_f7fcbb3f","line":82,"range":{"start_line":82,"start_character":11,"end_line":82,"end_character":72},"in_reply_to":"bff0334d_3307e91a","updated":"2017-04-13 09:50:35.000000000","message":"+1","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"a3dc0ab58cdc237bdca9727073941509971ca656","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        whitelist \u003d self.get_whitelist()"},{"line_number":114,"context_line":"        self.update_filter(blacklist\u003dblacklist, whitelist\u003dwhitelist)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def get_periodic_sync_task(self):"},{"line_number":117,"context_line":"        \"\"\"Get periodic sync task for the filter."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        :returns: a periodic task to be run in the background."},{"line_number":120,"context_line":"        \"\"\""},{"line_number":121,"context_line":"        ironic \u003d ir_utils.get_client()"},{"line_number":122,"context_line":"        return periodics.periodic("},{"line_number":123,"context_line":"            spacing\u003dCONF.pxe_filter.sync_period or 42,"},{"line_number":124,"context_line":"            enabled\u003dCONF.pxe_filter.sync_period and True or False"},{"line_number":125,"context_line":"        )(lambda: self.sync(ironic\u003dironic))"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"class NoopFilterDriver(FilterDriver):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_6127cd66","line":125,"range":{"start_line":116,"start_character":0,"end_line":125,"end_character":43},"updated":"2017-04-13 09:50:35.000000000","message":"why periodic task creating is part filter api?\n\nIt uses sync method which could be override anyway","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"78c7d5279d2a0bbe170a648fd103430106a9bf46","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        whitelist \u003d self.get_whitelist()"},{"line_number":114,"context_line":"        self.update_filter(blacklist\u003dblacklist, whitelist\u003dwhitelist)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def get_periodic_sync_task(self):"},{"line_number":117,"context_line":"        \"\"\"Get periodic sync task for the filter."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        :returns: a periodic task to be run in the background."},{"line_number":120,"context_line":"        \"\"\""},{"line_number":121,"context_line":"        ironic \u003d ir_utils.get_client()"},{"line_number":122,"context_line":"        return periodics.periodic("},{"line_number":123,"context_line":"            spacing\u003dCONF.pxe_filter.sync_period or 42,"},{"line_number":124,"context_line":"            enabled\u003dCONF.pxe_filter.sync_period and True or False"},{"line_number":125,"context_line":"        )(lambda: self.sync(ironic\u003dironic))"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"class NoopFilterDriver(FilterDriver):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_8d2c409a","line":125,"range":{"start_line":116,"start_character":0,"end_line":125,"end_character":43},"in_reply_to":"9ff52f3f_6127cd66","updated":"2017-04-13 10:32:38.000000000","message":"Exactly because of that. This part is the inspector interface of the driver API. If a driver needs to override the sync part, the periodic task API doesn\u0027t need to change.\nAlso, the configuration of the periodic task is encapsulated this way.","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"13d24929f70ae7220eaf0feeaa1ca2573c651058","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        whitelist \u003d self.get_whitelist()"},{"line_number":114,"context_line":"        self.update_filter(blacklist\u003dblacklist, whitelist\u003dwhitelist)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def get_periodic_sync_task(self):"},{"line_number":117,"context_line":"        \"\"\"Get periodic sync task for the filter."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        :returns: a periodic task to be run in the background."},{"line_number":120,"context_line":"        \"\"\""},{"line_number":121,"context_line":"        ironic \u003d ir_utils.get_client()"},{"line_number":122,"context_line":"        return periodics.periodic("},{"line_number":123,"context_line":"            spacing\u003dCONF.pxe_filter.sync_period or 42,"},{"line_number":124,"context_line":"            enabled\u003dCONF.pxe_filter.sync_period and True or False"},{"line_number":125,"context_line":"        )(lambda: self.sync(ironic\u003dironic))"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"class NoopFilterDriver(FilterDriver):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_f4727411","line":125,"range":{"start_line":116,"start_character":0,"end_line":125,"end_character":43},"in_reply_to":"9ff52f3f_8d2c409a","updated":"2017-04-13 12:07:21.000000000","message":"Not get it, yes, driver could override sync part, but why does it care about periodic task creation?","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"2164978c860df5b08a45c228ecae97b32590c41f","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        whitelist \u003d self.get_whitelist()"},{"line_number":114,"context_line":"        self.update_filter(blacklist\u003dblacklist, whitelist\u003dwhitelist)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def get_periodic_sync_task(self):"},{"line_number":117,"context_line":"        \"\"\"Get periodic sync task for the filter."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        :returns: a periodic task to be run in the background."},{"line_number":120,"context_line":"        \"\"\""},{"line_number":121,"context_line":"        ironic \u003d ir_utils.get_client()"},{"line_number":122,"context_line":"        return periodics.periodic("},{"line_number":123,"context_line":"            spacing\u003dCONF.pxe_filter.sync_period or 42,"},{"line_number":124,"context_line":"            enabled\u003dCONF.pxe_filter.sync_period and True or False"},{"line_number":125,"context_line":"        )(lambda: self.sync(ironic\u003dironic))"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"class NoopFilterDriver(FilterDriver):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_89e1c601","line":125,"range":{"start_line":116,"start_character":0,"end_line":125,"end_character":43},"in_reply_to":"9ff52f3f_f4727411","updated":"2017-04-13 19:07:25.000000000","message":"but that method inspector cares about, it\u0027s just attached to the driver instance (as it calls self.sync); if a driver  decides not to require any periodic tasks: return periodic(spacing\u003d42, enabled\u003dFalse)(lambda: None)","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":21909,"name":"Bob Fournier","email":"bfournie@redhat.com","username":"bfournie"},"change_message_id":"aa6a7cab1a4247b8760d2770841cd65fa69ac8a0","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    return _DRIVER_MANAGER"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"def _ib_mac_to_rmac_mapping(blacklist_macs, ports_active):"},{"line_number":162,"context_line":"    \"\"\"Mapping between host InfiniBand MAC to EthernetOverInfiniBand MAC"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    On InfiniBand deployment we need to map between the baremetal host"}],"source_content_type":"text/x-python","patch_set":6,"id":"bff0334d_935c7519","line":161,"range":{"start_line":161,"start_character":28,"end_line":161,"end_character":42},"updated":"2017-04-12 19:27:13.000000000","message":"Likewise this is a bit confusing as its actually the macs of all active ports, not just blacklisted macs that are being mapped.  Maybe change to just \"macs\"? The implementation is a bit different than current implementation in which the node_cache.active_macs() have been removed from the list of macs.","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"78c7d5279d2a0bbe170a648fd103430106a9bf46","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    return _DRIVER_MANAGER"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"def _ib_mac_to_rmac_mapping(blacklist_macs, ports_active):"},{"line_number":162,"context_line":"    \"\"\"Mapping between host InfiniBand MAC to EthernetOverInfiniBand MAC"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    On InfiniBand deployment we need to map between the baremetal host"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_32947144","line":161,"range":{"start_line":161,"start_character":28,"end_line":161,"end_character":42},"in_reply_to":"bff0334d_935c7519","updated":"2017-04-13 10:32:38.000000000","message":"The same reasons as above; generic encapsulation of ironic.port.list.","commit_id":"270288ee01c4bd60cae8389c06bef83cdfb9a6c5"}],"ironic_inspector/pxe_filter/base.py":[{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"04d75fdc76a0ea86d69368f4d6f5929e40651f32","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        \"\"\""},{"line_number":74,"context_line":"        ironic \u003d ir_utils.get_client()"},{"line_number":75,"context_line":"        return periodics.periodic("},{"line_number":76,"context_line":"            spacing\u003dCONF.pxe_filter.sync_period or 42,"},{"line_number":77,"context_line":"            enabled\u003dCONF.pxe_filter.sync_period and True or False"},{"line_number":78,"context_line":"        )(lambda: self.sync(ironic\u003dironic))"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_6dfbc178","line":76,"range":{"start_line":76,"start_character":51,"end_line":76,"end_character":53},"updated":"2017-05-22 12:48:28.000000000","message":"42?","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"a5cbc12ff444bd94dbca2dad7c1996d8dfad3c2e","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        \"\"\""},{"line_number":74,"context_line":"        ironic \u003d ir_utils.get_client()"},{"line_number":75,"context_line":"        return periodics.periodic("},{"line_number":76,"context_line":"            spacing\u003dCONF.pxe_filter.sync_period or 42,"},{"line_number":77,"context_line":"            enabled\u003dCONF.pxe_filter.sync_period and True or False"},{"line_number":78,"context_line":"        )(lambda: self.sync(ironic\u003dironic))"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_ed4bbfad","line":76,"range":{"start_line":76,"start_character":51,"end_line":76,"end_character":53},"in_reply_to":"ff0f0b1f_6dfbc178","updated":"2017-05-29 10:03:00.000000000","message":"yeah spacing\u003d\u003d0 isn\u0027t accepted by periodic even if enabled\u003d\u003dFalse. I can use infinity I guess ;)","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"04d75fdc76a0ea86d69368f4d6f5929e40651f32","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        ironic \u003d ir_utils.get_client()"},{"line_number":75,"context_line":"        return periodics.periodic("},{"line_number":76,"context_line":"            spacing\u003dCONF.pxe_filter.sync_period or 42,"},{"line_number":77,"context_line":"            enabled\u003dCONF.pxe_filter.sync_period and True or False"},{"line_number":78,"context_line":"        )(lambda: self.sync(ironic\u003dironic))"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_2d1f09b8","line":77,"range":{"start_line":77,"start_character":20,"end_line":77,"end_character":65},"updated":"2017-05-22 12:48:28.000000000","message":"nit: convert to bool:\n        bool(sync_period)","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"a5cbc12ff444bd94dbca2dad7c1996d8dfad3c2e","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        ironic \u003d ir_utils.get_client()"},{"line_number":75,"context_line":"        return periodics.periodic("},{"line_number":76,"context_line":"            spacing\u003dCONF.pxe_filter.sync_period or 42,"},{"line_number":77,"context_line":"            enabled\u003dCONF.pxe_filter.sync_period and True or False"},{"line_number":78,"context_line":"        )(lambda: self.sync(ironic\u003dironic))"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_2d009734","line":77,"range":{"start_line":77,"start_character":20,"end_line":77,"end_character":65},"in_reply_to":"ff0f0b1f_2d1f09b8","updated":"2017-05-29 10:03:00.000000000","message":"Done","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"04d75fdc76a0ea86d69368f4d6f5929e40651f32","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    \"\"\"A trivial PXE boot filter.\"\"\""},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def init_filter(self):  # pragma: no cover"},{"line_number":85,"context_line":"        LOG.info(\u0027Initializing the Noop filter driver\u0027)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def sync(self, ironic\u003dNone):  # pragma: no cover"},{"line_number":88,"context_line":"        LOG.info(\u0027Synchronizing the Noop filter driver\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_2d46e9c1","line":85,"range":{"start_line":85,"start_character":47,"end_line":85,"end_character":53},"updated":"2017-05-22 12:48:28.000000000","message":"nit: maybe drop `driver` part?","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"a5cbc12ff444bd94dbca2dad7c1996d8dfad3c2e","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    \"\"\"A trivial PXE boot filter.\"\"\""},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def init_filter(self):  # pragma: no cover"},{"line_number":85,"context_line":"        LOG.info(\u0027Initializing the Noop filter driver\u0027)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def sync(self, ironic\u003dNone):  # pragma: no cover"},{"line_number":88,"context_line":"        LOG.info(\u0027Synchronizing the Noop filter driver\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_2d8537ae","line":85,"range":{"start_line":85,"start_character":47,"end_line":85,"end_character":53},"in_reply_to":"ff0f0b1f_2d46e9c1","updated":"2017-05-29 10:03:00.000000000","message":"Done","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"04d75fdc76a0ea86d69368f4d6f5929e40651f32","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        LOG.info(\u0027Initializing the Noop filter driver\u0027)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def sync(self, ironic\u003dNone):  # pragma: no cover"},{"line_number":88,"context_line":"        LOG.info(\u0027Synchronizing the Noop filter driver\u0027)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def tear_down_filter(self):  # pragma: no cover"},{"line_number":91,"context_line":"        LOG.info(\u0027Tearing down the Noop PXE boot filter\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_ed15919d","line":88,"range":{"start_line":88,"start_character":48,"end_line":88,"end_character":54},"updated":"2017-05-22 12:48:28.000000000","message":"ditto","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"a5cbc12ff444bd94dbca2dad7c1996d8dfad3c2e","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        LOG.info(\u0027Initializing the Noop filter driver\u0027)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def sync(self, ironic\u003dNone):  # pragma: no cover"},{"line_number":88,"context_line":"        LOG.info(\u0027Synchronizing the Noop filter driver\u0027)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def tear_down_filter(self):  # pragma: no cover"},{"line_number":91,"context_line":"        LOG.info(\u0027Tearing down the Noop PXE boot filter\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_0d9273f7","line":88,"range":{"start_line":88,"start_character":48,"end_line":88,"end_character":54},"in_reply_to":"ff0f0b1f_ed15919d","updated":"2017-05-29 10:03:00.000000000","message":"Done","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"36857962de70410aba51ee14cee8640ad0cca7f0","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        LOG.info(\u0027Synchronizing the Noop filter driver\u0027)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def tear_down_filter(self):  # pragma: no cover"},{"line_number":91,"context_line":"        LOG.info(\u0027Tearing down the Noop PXE boot filter\u0027)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"_DRIVER_MANAGER \u003d None"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_3611caad","line":91,"range":{"start_line":91,"start_character":40,"end_line":91,"end_character":48},"updated":"2017-05-19 13:44:07.000000000","message":"inconsistent messages","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"a5cbc12ff444bd94dbca2dad7c1996d8dfad3c2e","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        LOG.info(\u0027Synchronizing the Noop filter driver\u0027)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def tear_down_filter(self):  # pragma: no cover"},{"line_number":91,"context_line":"        LOG.info(\u0027Tearing down the Noop PXE boot filter\u0027)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"_DRIVER_MANAGER \u003d None"}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_ed8e1fcf","line":91,"range":{"start_line":91,"start_character":40,"end_line":91,"end_character":48},"in_reply_to":"ff0f0b1f_3611caad","updated":"2017-05-29 10:03:00.000000000","message":"Done","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"04d75fdc76a0ea86d69368f4d6f5929e40651f32","unresolved":false,"context_lines":[{"line_number":94,"context_line":"_DRIVER_MANAGER \u003d None"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"def driver_manager():"},{"line_number":98,"context_line":"    \"\"\"Create a Stevedore driver manager for filtering drivers.\"\"\""},{"line_number":99,"context_line":"    global _DRIVER_MANAGER"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_33752a33","line":97,"range":{"start_line":97,"start_character":5,"end_line":97,"end_character":21},"updated":"2017-05-22 12:48:28.000000000","message":"what about adding method which returns driver, so we could do:\n\n    pxe_filter.driver().sync()","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"a5cbc12ff444bd94dbca2dad7c1996d8dfad3c2e","unresolved":false,"context_lines":[{"line_number":94,"context_line":"_DRIVER_MANAGER \u003d None"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"def driver_manager():"},{"line_number":98,"context_line":"    \"\"\"Create a Stevedore driver manager for filtering drivers.\"\"\""},{"line_number":99,"context_line":"    global _DRIVER_MANAGER"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_ad1ee76d","line":97,"range":{"start_line":97,"start_character":5,"end_line":97,"end_character":21},"in_reply_to":"ff0f0b1f_33752a33","updated":"2017-05-29 10:03:00.000000000","message":"hmm would render the driver_manager useless I guess.\nSo maybe rename driver_manager() to _driver_manager() and make driver() the preferred interface?","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"9df835fd001ba0fd66193e6b57dbbb5300438e04","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    \"\"\"The PXE boot filtering interface.\"\"\""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def __init__(self):"},{"line_number":37,"context_line":"        \"\"\"Called by Stevedore to configure the driver.\"\"\""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    @abc.abstractmethod"},{"line_number":40,"context_line":"    def init_filter(self):"}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_690808d9","line":37,"updated":"2017-06-05 10:15:18.000000000","message":"nit: redundant (and if present, should ideally call super.__init__)","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"f921f69613e64324a176ae28dd402388c3c7b176","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    \"\"\"The PXE boot filtering interface.\"\"\""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def __init__(self):"},{"line_number":37,"context_line":"        \"\"\"Called by Stevedore to configure the driver.\"\"\""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    @abc.abstractmethod"},{"line_number":40,"context_line":"    def init_filter(self):"}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_4ee4210d","line":37,"in_reply_to":"df140735_690808d9","updated":"2017-06-05 15:40:47.000000000","message":"Done","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"9df835fd001ba0fd66193e6b57dbbb5300438e04","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    def __init__(self):"},{"line_number":37,"context_line":"        \"\"\"Called by Stevedore to configure the driver.\"\"\""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    @abc.abstractmethod"},{"line_number":40,"context_line":"    def init_filter(self):"},{"line_number":41,"context_line":"        \"\"\"Initialize the internal driver state."},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_490b04d5","line":39,"updated":"2017-06-05 10:15:18.000000000","message":"I wonder if it should be abstract even. some drivers may want to skip it..","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"f921f69613e64324a176ae28dd402388c3c7b176","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    def __init__(self):"},{"line_number":37,"context_line":"        \"\"\"Called by Stevedore to configure the driver.\"\"\""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    @abc.abstractmethod"},{"line_number":40,"context_line":"    def init_filter(self):"},{"line_number":41,"context_line":"        \"\"\"Initialize the internal driver state."},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_cea6f1c1","line":39,"in_reply_to":"df140735_490b04d5","updated":"2017-06-05 15:40:47.000000000","message":"might imply the generic method handling internal state to some extent, such as how/whether to lock a driver","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"9df835fd001ba0fd66193e6b57dbbb5300438e04","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        To be called both periodically and as needed by inspector."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        :param ironic: an optional ironic client instance."},{"line_number":56,"context_line":"        :returns: nothing."},{"line_number":57,"context_line":"        \"\"\""},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_290e90e4","line":55,"updated":"2017-06-05 10:15:18.000000000","message":"optional things are not great for abstract interfaces. I think we need a wrapper around this method that will ensure the client instance.","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"f921f69613e64324a176ae28dd402388c3c7b176","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        To be called both periodically and as needed by inspector."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        :param ironic: an optional ironic client instance."},{"line_number":56,"context_line":"        :returns: nothing."},{"line_number":57,"context_line":"        \"\"\""},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_ee65351f","line":55,"in_reply_to":"df140735_290e90e4","updated":"2017-06-05 15:40:47.000000000","message":"I guess just the Noop driver requires no Ironic to talk to. On the other hand, inspector uses both sync() and sync(ironic\u003dironic). Was firewall.update_filters(ironic\u003dNone) before, but internally the ports were always fetched. Will try to fix somehow.","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"9df835fd001ba0fd66193e6b57dbbb5300438e04","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        To be called both periodically and as needed by inspector."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        :param ironic: an optional ironic client instance."},{"line_number":56,"context_line":"        :returns: nothing."},{"line_number":57,"context_line":"        \"\"\""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_09118c04","line":56,"updated":"2017-06-05 10:15:18.000000000","message":"let\u0027s document what happens if it raises (nothing?)","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"f921f69613e64324a176ae28dd402388c3c7b176","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        To be called both periodically and as needed by inspector."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        :param ironic: an optional ironic client instance."},{"line_number":56,"context_line":"        :returns: nothing."},{"line_number":57,"context_line":"        \"\"\""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_39f2599b","line":56,"in_reply_to":"df140735_09118c04","updated":"2017-06-05 15:40:47.000000000","message":"Done","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"9df835fd001ba0fd66193e6b57dbbb5300438e04","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            # NOTE(milan): the periodic decorator doesn\u0027t support 0 as"},{"line_number":77,"context_line":"            # a spacing value of (a switched off) periodic"},{"line_number":78,"context_line":"            spacing\u003dCONF.pxe_filter.sync_period or float(\u0027inf\u0027),"},{"line_number":79,"context_line":"            enabled\u003dbool(CONF.pxe_filter.sync_period) and True or False"},{"line_number":80,"context_line":"        )(lambda: self.sync(ironic\u003dironic))"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_e9fbf8bd","line":79,"updated":"2017-06-05 10:15:18.000000000","message":"\"and True or False\" is completely redundant, bool() is enough","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"f921f69613e64324a176ae28dd402388c3c7b176","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            # NOTE(milan): the periodic decorator doesn\u0027t support 0 as"},{"line_number":77,"context_line":"            # a spacing value of (a switched off) periodic"},{"line_number":78,"context_line":"            spacing\u003dCONF.pxe_filter.sync_period or float(\u0027inf\u0027),"},{"line_number":79,"context_line":"            enabled\u003dbool(CONF.pxe_filter.sync_period) and True or False"},{"line_number":80,"context_line":"        )(lambda: self.sync(ironic\u003dironic))"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_0e986972","line":79,"in_reply_to":"df140735_e9fbf8bd","updated":"2017-06-05 15:40:47.000000000","message":"lol yeah :D","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"9df835fd001ba0fd66193e6b57dbbb5300438e04","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        LOG.info(\u0027The Noop filter was initialized\u0027)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def sync(self, ironic\u003dNone):  # pragma: no cover"},{"line_number":90,"context_line":"        LOG.info(\u0027The Noop filter was synchronized\u0027)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def tear_down_filter(self):  # pragma: no cover"},{"line_number":93,"context_line":"        LOG.info(\u0027The Noop filter was torn down\u0027)"}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_c9f6f4d7","line":90,"updated":"2017-06-05 10:15:18.000000000","message":"s/info/debug/ (it will spam the logs otherwise)","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"f921f69613e64324a176ae28dd402388c3c7b176","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        LOG.info(\u0027The Noop filter was initialized\u0027)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def sync(self, ironic\u003dNone):  # pragma: no cover"},{"line_number":90,"context_line":"        LOG.info(\u0027The Noop filter was synchronized\u0027)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def tear_down_filter(self):  # pragma: no cover"},{"line_number":93,"context_line":"        LOG.info(\u0027The Noop filter was torn down\u0027)"}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_9923a5a7","line":90,"in_reply_to":"df140735_c9f6f4d7","updated":"2017-06-05 15:40:47.000000000","message":"Done","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"f921f69613e64324a176ae28dd402388c3c7b176","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    name \u003d CONF.pxe_filter.driver"},{"line_number":104,"context_line":"    if _DRIVER_MANAGER is None:"},{"line_number":105,"context_line":"        _DRIVER_MANAGER \u003d stevedore.driver.DriverManager("},{"line_number":106,"context_line":"            _STEVEDORE_DRIVER_NAMESPACE,"},{"line_number":107,"context_line":"            name\u003dname,"},{"line_number":108,"context_line":"            invoke_on_load\u003dTrue"}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_19b2f549","line":105,"range":{"start_line":105,"start_character":0,"end_line":105,"end_character":57},"updated":"2017-06-05 15:40:47.000000000","message":"this I guess might be racy on a worker; will protect with a lock","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"d26029349f1fe96b781e13e26fd4ace3b680d415","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self._lock.acquire(blocking\u003dTrue)"},{"line_number":79,"context_line":"        try:"},{"line_number":80,"context_line":"            yield self"},{"line_number":81,"context_line":"        except UninitializedDriverError as e:"},{"line_number":82,"context_line":"            LOG.exception(\u0027The filter encountered an exception %s\u0027, e)"},{"line_number":83,"context_line":"            raise"},{"line_number":84,"context_line":"        except Exception as e:"}],"source_content_type":"text/x-python","patch_set":20,"id":"7f231b9d_ce87c7d7","line":81,"updated":"2017-06-12 09:30:16.000000000","message":"Hmm, when UninitializedDriverError could be raised?\n\nIf we in context manager then driver should be initialized, line 74","commit_id":"dab7c65f83945501fdd695ab25d07ece42d92f5d"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"123fc41dd5727740232d467c55e0b2e6f3fdd02e","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self._lock.acquire(blocking\u003dTrue)"},{"line_number":79,"context_line":"        try:"},{"line_number":80,"context_line":"            yield self"},{"line_number":81,"context_line":"        except UninitializedDriverError as e:"},{"line_number":82,"context_line":"            LOG.exception(\u0027The filter encountered an exception %s\u0027, e)"},{"line_number":83,"context_line":"            raise"},{"line_number":84,"context_line":"        except Exception as e:"}],"source_content_type":"text/x-python","patch_set":20,"id":"7f231b9d_a445c719","line":81,"in_reply_to":"7f231b9d_ce87c7d7","updated":"2017-06-12 12:23:23.000000000","message":"This is a really good point, however, the filter need not be initialized; The filter is a singleton, shared between the threads. There\u0027s the periodic sync task running that might encounter an error and since we reset the filter in the handler, the issue would propagate this way into another introspection/processing/periodic sync() call.\n\nI could bump the check into the locked context, but would have to release the lock later. In that case it would have be best to bump into the try: except block; but again, would have to deal with the uninitialized exception (due to the if statement this time).\n\nNot sure what\u0027s better.","commit_id":"dab7c65f83945501fdd695ab25d07ece42d92f5d"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"d26029349f1fe96b781e13e26fd4ace3b680d415","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        try:"},{"line_number":80,"context_line":"            yield self"},{"line_number":81,"context_line":"        except UninitializedDriverError as e:"},{"line_number":82,"context_line":"            LOG.exception(\u0027The filter encountered an exception %s\u0027, e)"},{"line_number":83,"context_line":"            raise"},{"line_number":84,"context_line":"        except Exception as e:"},{"line_number":85,"context_line":"            LOG.exception(\u0027The filter encountered %s; tearing down filter\u0027, e)"}],"source_content_type":"text/x-python","patch_set":20,"id":"7f231b9d_ee13a365","line":82,"range":{"start_line":82,"start_character":27,"end_line":82,"end_character":62},"updated":"2017-06-12 09:30:16.000000000","message":"In case we need to handle this exc, this msg could be more specific.","commit_id":"dab7c65f83945501fdd695ab25d07ece42d92f5d"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"123fc41dd5727740232d467c55e0b2e6f3fdd02e","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        try:"},{"line_number":80,"context_line":"            yield self"},{"line_number":81,"context_line":"        except UninitializedDriverError as e:"},{"line_number":82,"context_line":"            LOG.exception(\u0027The filter encountered an exception %s\u0027, e)"},{"line_number":83,"context_line":"            raise"},{"line_number":84,"context_line":"        except Exception as e:"},{"line_number":85,"context_line":"            LOG.exception(\u0027The filter encountered %s; tearing down filter\u0027, e)"}],"source_content_type":"text/x-python","patch_set":20,"id":"7f231b9d_0460fba4","line":82,"range":{"start_line":82,"start_character":27,"end_line":82,"end_character":62},"in_reply_to":"7f231b9d_ee13a365","updated":"2017-06-12 12:23:23.000000000","message":"My take on it is this has already been handled before ^^, in the _reset method. What would you suggest?","commit_id":"dab7c65f83945501fdd695ab25d07ece42d92f5d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e1d767380674ee6a569a76f3145fed7f6910565d","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        :returns: nothing."},{"line_number":60,"context_line":"        \"\"\""},{"line_number":61,"context_line":"        LOG.debug(\u0027Resetting driver\u0027)"},{"line_number":62,"context_line":"        self._initialized \u003d False"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @contextlib.contextmanager"}],"source_content_type":"text/x-python","patch_set":21,"id":"7f231b9d_6d3ce4be","line":61,"updated":"2017-06-14 10:00:35.000000000","message":"even:\n\n LOG.debug(\"Resetting PXE driver %s\", self.__class__.__name__)","commit_id":"39b2238460b8166d51bc45461ad3fc73988070b6"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"b72c2726105621ffc340513712c09c6622b81799","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        :returns: nothing."},{"line_number":60,"context_line":"        \"\"\""},{"line_number":61,"context_line":"        LOG.debug(\u0027Resetting driver\u0027)"},{"line_number":62,"context_line":"        self._initialized \u003d False"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @contextlib.contextmanager"}],"source_content_type":"text/x-python","patch_set":21,"id":"7f231b9d_14b48934","line":61,"range":{"start_line":61,"start_character":19,"end_line":61,"end_character":36},"updated":"2017-06-13 08:07:22.000000000","message":"nit: PXE driver, it would be more clear","commit_id":"39b2238460b8166d51bc45461ad3fc73988070b6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e1d767380674ee6a569a76f3145fed7f6910565d","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        self._initialized \u003d False"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @contextlib.contextmanager"},{"line_number":65,"context_line":"    def precautions(self):"},{"line_number":66,"context_line":"        \"\"\"Perform an action with a locked filter."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        self._reset is called upon any exception but"}],"source_content_type":"text/x-python","patch_set":21,"id":"7f231b9d_4d4b6858","line":65,"updated":"2017-06-14 10:00:35.000000000","message":"this is a cool name, but let\u0027s call it \"locked\" or something else. \"precautions\" is too generic.","commit_id":"39b2238460b8166d51bc45461ad3fc73988070b6"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"d4320b89567af11a516f3e41721230b4363dd956","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        self._initialized \u003d False"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @contextlib.contextmanager"},{"line_number":65,"context_line":"    def precautions(self):"},{"line_number":66,"context_line":"        \"\"\"Perform an action with a locked filter."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        self._reset is called upon any exception but"}],"source_content_type":"text/x-python","patch_set":21,"id":"7f231b9d_e1d6bb27","line":65,"in_reply_to":"7f231b9d_4d4b6858","updated":"2017-06-14 13:16:47.000000000","message":"the precautions means: watch out, I\u0027m locked and I\u0027m gonna _reset() myself should anything suspicious happen. I can\u0027t promise I\u0027ll come up with a better name, but lemme try ;)","commit_id":"39b2238460b8166d51bc45461ad3fc73988070b6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e1d767380674ee6a569a76f3145fed7f6910565d","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @contextlib.contextmanager"},{"line_number":65,"context_line":"    def precautions(self):"},{"line_number":66,"context_line":"        \"\"\"Perform an action with a locked filter."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        self._reset is called upon any exception but"},{"line_number":69,"context_line":"        UninitializedDriverError."}],"source_content_type":"text/x-python","patch_set":21,"id":"7f231b9d_2d46ec50","line":66,"updated":"2017-06-14 10:00:35.000000000","message":"It\u0027s not clear how this call should be used, given that on any error it kills the driver","commit_id":"39b2238460b8166d51bc45461ad3fc73988070b6"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"d4320b89567af11a516f3e41721230b4363dd956","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @contextlib.contextmanager"},{"line_number":65,"context_line":"    def precautions(self):"},{"line_number":66,"context_line":"        \"\"\"Perform an action with a locked filter."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        self._reset is called upon any exception but"},{"line_number":69,"context_line":"        UninitializedDriverError."}],"source_content_type":"text/x-python","patch_set":21,"id":"7f231b9d_01a2d7ae","line":66,"in_reply_to":"7f231b9d_2d46ec50","updated":"2017-06-14 13:16:47.000000000","message":"I can elaborate on the doc string a bit","commit_id":"39b2238460b8166d51bc45461ad3fc73988070b6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e1d767380674ee6a569a76f3145fed7f6910565d","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        if not self._initialized:"},{"line_number":75,"context_line":"            raise UninitializedDriverError(_(\u0027The filter was not initialized\u0027))"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        LOG.debug(\u0027The filter %s enters the precautions context\u0027, self)"},{"line_number":78,"context_line":"        self._lock.acquire(blocking\u003dTrue)"},{"line_number":79,"context_line":"        try:"},{"line_number":80,"context_line":"            yield self"}],"source_content_type":"text/x-python","patch_set":21,"id":"7f231b9d_0d77b0a2","line":77,"updated":"2017-06-14 10:00:35.000000000","message":"self.__class__.__name__","commit_id":"39b2238460b8166d51bc45461ad3fc73988070b6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e1d767380674ee6a569a76f3145fed7f6910565d","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        try:"},{"line_number":80,"context_line":"            yield self"},{"line_number":81,"context_line":"        except UninitializedDriverError as e:"},{"line_number":82,"context_line":"            LOG.exception(\u0027Another thread reset the driver. Exception: %s\u0027, e)"},{"line_number":83,"context_line":"            raise"},{"line_number":84,"context_line":"        except Exception as e:"},{"line_number":85,"context_line":"            LOG.exception(\u0027The filter encountered %s; tearing down filter\u0027, e)"}],"source_content_type":"text/x-python","patch_set":21,"id":"7f231b9d_ed791493","line":82,"updated":"2017-06-14 10:00:35.000000000","message":"I don\u0027t think the exception details are useful here. I\u0027d change it to LOG.error without passing \"e\"\n\nactually, how is it even possible? we do not call _reset without lock anywhere..","commit_id":"39b2238460b8166d51bc45461ad3fc73988070b6"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"d4320b89567af11a516f3e41721230b4363dd956","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            LOG.exception(\u0027Another thread reset the driver. Exception: %s\u0027, e)"},{"line_number":83,"context_line":"            raise"},{"line_number":84,"context_line":"        except Exception as e:"},{"line_number":85,"context_line":"            LOG.exception(\u0027The filter encountered %s; tearing down filter\u0027, e)"},{"line_number":86,"context_line":"            self._reset()"},{"line_number":87,"context_line":"            raise"},{"line_number":88,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":21,"id":"7f231b9d_a1032373","line":85,"range":{"start_line":85,"start_character":54,"end_line":85,"end_character":61},"updated":"2017-06-14 13:16:47.000000000","message":"should probably read: resetting","commit_id":"39b2238460b8166d51bc45461ad3fc73988070b6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e1d767380674ee6a569a76f3145fed7f6910565d","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            raise"},{"line_number":84,"context_line":"        except Exception as e:"},{"line_number":85,"context_line":"            LOG.exception(\u0027The filter encountered %s; tearing down filter\u0027, e)"},{"line_number":86,"context_line":"            self._reset()"},{"line_number":87,"context_line":"            raise"},{"line_number":88,"context_line":"        finally:"},{"line_number":89,"context_line":"            self._lock.release()"}],"source_content_type":"text/x-python","patch_set":21,"id":"7f231b9d_cd7098a8","line":86,"updated":"2017-06-14 10:00:35.000000000","message":"this is a problem - see below","commit_id":"39b2238460b8166d51bc45461ad3fc73988070b6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e1d767380674ee6a569a76f3145fed7f6910565d","unresolved":false,"context_lines":[{"line_number":140,"context_line":"    \"\"\"A trivial PXE boot filter.\"\"\""},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def sync(self, ironic):  # pragma: no cover"},{"line_number":143,"context_line":"        with self.precautions():"},{"line_number":144,"context_line":"            LOG.debug(\u0027The Noop filter was synchronized\u0027)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"7f231b9d_ad731cb1","line":143,"updated":"2017-06-14 10:00:35.000000000","message":"aha, this is the problem. this context manager tears down the filter on any error. which will cause the filter to stop working, but it will NOT cause the process to abort. leaving an ironic-inspector process with a non-functioning filter.\n\nI think exception handling has to be smarter here. we should allow sync() to be fail several times in a row, then abort the whole process, if it never succeeds.","commit_id":"39b2238460b8166d51bc45461ad3fc73988070b6"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"d4320b89567af11a516f3e41721230b4363dd956","unresolved":false,"context_lines":[{"line_number":140,"context_line":"    \"\"\"A trivial PXE boot filter.\"\"\""},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def sync(self, ironic):  # pragma: no cover"},{"line_number":143,"context_line":"        with self.precautions():"},{"line_number":144,"context_line":"            LOG.debug(\u0027The Noop filter was synchronized\u0027)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"7f231b9d_8174a769","line":143,"in_reply_to":"7f231b9d_ad731cb1","updated":"2017-06-14 13:16:47.000000000","message":"\u003e aha, this is the problem. this context manager tears down \n\u003e the filter on any error. which will cause the filter to \n\u003e stop working, but it will NOT cause the process to abort. \n\u003e leaving an ironic-inspector process with a non-functioning \n\u003e filter.\n\nThe _reset is called so the filter is non-working indeed (and the error(s) were logged) but more importantly DHCP is not passing in so we\u0027re \"safe\" O:-)\n\n\u003e I think exception handling has to be smarter here. we \n\u003e should allow sync() to be fail several times in a row, \n\u003e then abort the whole process, if it never succeeds.\n\nI\u0027m unsure how useful/reasonable it might be to retry initializing a driver.\nThe racy part though is the self._initialized check (outside of the self._lock.acquire()) so I may put it into the try: except: finally block so it can still raise and unlock the filter should an (unrecoverable/configuration) error happen.\n\nAnother thing is we\u0027re handling couple of threads possibly. So we\u0027d have to introduce a \"signal\" (greenlet.event) propagating the necessity to kill the process and join all the threads. I imagine this is going to be a code-heavy thing so I\u0027d suggest an follow-up, wdyt?","commit_id":"39b2238460b8166d51bc45461ad3fc73988070b6"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"e85a6e8d16ba3ed87547887ff4d068a3db7c70f6","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    initialized \u003d \u0027initialized\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"class Events(object):"},{"line_number":50,"context_line":"    \"\"\"PXE filter driver transitions.\"\"\""},{"line_number":51,"context_line":"    initialize \u003d \u0027initialize\u0027"},{"line_number":52,"context_line":"    sync \u003d \u0027sync\u0027"},{"line_number":53,"context_line":"    reset \u003d \u0027reset\u0027"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"# a reset is always possible"},{"line_number":57,"context_line":"State_space \u003d ["},{"line_number":58,"context_line":"    {"},{"line_number":59,"context_line":"        \u0027name\u0027: States.uninitialized,"},{"line_number":60,"context_line":"        \u0027next_states\u0027: {"},{"line_number":61,"context_line":"            Events.initialize: States.initialized,"},{"line_number":62,"context_line":"            Events.reset: States.uninitialized,"},{"line_number":63,"context_line":"        },"},{"line_number":64,"context_line":"    },"},{"line_number":65,"context_line":"    {"},{"line_number":66,"context_line":"        \u0027name\u0027: States.initialized,"},{"line_number":67,"context_line":"        \u0027next_states\u0027: {"},{"line_number":68,"context_line":"            Events.sync: States.initialized,"},{"line_number":69,"context_line":"            Events.reset: States.uninitialized,"},{"line_number":70,"context_line":"        },"},{"line_number":71,"context_line":"    },"},{"line_number":72,"context_line":"]"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"def locked_driver_event(event):"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f231b9d_cf749300","line":72,"range":{"start_line":49,"start_character":0,"end_line":72,"end_character":1},"updated":"2017-06-19 13:36:06.000000000","message":"Wow, why do you need fsm here?\n\nIt\u0027s really complicate the driver. Also simple flag `initialized` was enough in prev patch set.","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"739ac310c91568f9acb056743f671f05c2d78d2f","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    initialized \u003d \u0027initialized\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"class Events(object):"},{"line_number":50,"context_line":"    \"\"\"PXE filter driver transitions.\"\"\""},{"line_number":51,"context_line":"    initialize \u003d \u0027initialize\u0027"},{"line_number":52,"context_line":"    sync \u003d \u0027sync\u0027"},{"line_number":53,"context_line":"    reset \u003d \u0027reset\u0027"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"# a reset is always possible"},{"line_number":57,"context_line":"State_space \u003d ["},{"line_number":58,"context_line":"    {"},{"line_number":59,"context_line":"        \u0027name\u0027: States.uninitialized,"},{"line_number":60,"context_line":"        \u0027next_states\u0027: {"},{"line_number":61,"context_line":"            Events.initialize: States.initialized,"},{"line_number":62,"context_line":"            Events.reset: States.uninitialized,"},{"line_number":63,"context_line":"        },"},{"line_number":64,"context_line":"    },"},{"line_number":65,"context_line":"    {"},{"line_number":66,"context_line":"        \u0027name\u0027: States.initialized,"},{"line_number":67,"context_line":"        \u0027next_states\u0027: {"},{"line_number":68,"context_line":"            Events.sync: States.initialized,"},{"line_number":69,"context_line":"            Events.reset: States.uninitialized,"},{"line_number":70,"context_line":"        },"},{"line_number":71,"context_line":"    },"},{"line_number":72,"context_line":"]"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"def locked_driver_event(event):"}],"source_content_type":"text/x-python","patch_set":22,"id":"5f201791_a8aebfe4","line":72,"range":{"start_line":49,"start_character":0,"end_line":72,"end_character":1},"in_reply_to":"5f201791_9b98f86a","updated":"2017-06-21 13:54:35.000000000","message":"\u003e I follow the rule - keep the interface simple. The best \n\u003e interfaces are almost invisible to the user.\n\nThis is IMO the smallest interface possible; a discrete state change\n\n\u003e In 99.9% cases transition initialized -\u003e initialized will be used.\n\nIn 99.9% race conditions don\u0027t happen yet we use locks\n\n\u003e Also event.sync in uninitialized seems possible...\n\nNo, that would trigger the automaton.errors.NotFound exception","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ceb19e073b8f9ef4764dd770e16b78c199741723","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    initialized \u003d \u0027initialized\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"class Events(object):"},{"line_number":50,"context_line":"    \"\"\"PXE filter driver transitions.\"\"\""},{"line_number":51,"context_line":"    initialize \u003d \u0027initialize\u0027"},{"line_number":52,"context_line":"    sync \u003d \u0027sync\u0027"},{"line_number":53,"context_line":"    reset \u003d \u0027reset\u0027"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"# a reset is always possible"},{"line_number":57,"context_line":"State_space \u003d ["},{"line_number":58,"context_line":"    {"},{"line_number":59,"context_line":"        \u0027name\u0027: States.uninitialized,"},{"line_number":60,"context_line":"        \u0027next_states\u0027: {"},{"line_number":61,"context_line":"            Events.initialize: States.initialized,"},{"line_number":62,"context_line":"            Events.reset: States.uninitialized,"},{"line_number":63,"context_line":"        },"},{"line_number":64,"context_line":"    },"},{"line_number":65,"context_line":"    {"},{"line_number":66,"context_line":"        \u0027name\u0027: States.initialized,"},{"line_number":67,"context_line":"        \u0027next_states\u0027: {"},{"line_number":68,"context_line":"            Events.sync: States.initialized,"},{"line_number":69,"context_line":"            Events.reset: States.uninitialized,"},{"line_number":70,"context_line":"        },"},{"line_number":71,"context_line":"    },"},{"line_number":72,"context_line":"]"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"def locked_driver_event(event):"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f231b9d_9f20e69d","line":72,"range":{"start_line":49,"start_character":0,"end_line":72,"end_character":1},"in_reply_to":"7f231b9d_7b62deaf","updated":"2017-06-20 12:24:07.000000000","message":"I actually like an explicit state machine, as opposed to something hidden by a boolean flag.","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"70dfc8d77822c984db07bcb27c0917b8d5524af6","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    initialized \u003d \u0027initialized\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"class Events(object):"},{"line_number":50,"context_line":"    \"\"\"PXE filter driver transitions.\"\"\""},{"line_number":51,"context_line":"    initialize \u003d \u0027initialize\u0027"},{"line_number":52,"context_line":"    sync \u003d \u0027sync\u0027"},{"line_number":53,"context_line":"    reset \u003d \u0027reset\u0027"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"# a reset is always possible"},{"line_number":57,"context_line":"State_space \u003d ["},{"line_number":58,"context_line":"    {"},{"line_number":59,"context_line":"        \u0027name\u0027: States.uninitialized,"},{"line_number":60,"context_line":"        \u0027next_states\u0027: {"},{"line_number":61,"context_line":"            Events.initialize: States.initialized,"},{"line_number":62,"context_line":"            Events.reset: States.uninitialized,"},{"line_number":63,"context_line":"        },"},{"line_number":64,"context_line":"    },"},{"line_number":65,"context_line":"    {"},{"line_number":66,"context_line":"        \u0027name\u0027: States.initialized,"},{"line_number":67,"context_line":"        \u0027next_states\u0027: {"},{"line_number":68,"context_line":"            Events.sync: States.initialized,"},{"line_number":69,"context_line":"            Events.reset: States.uninitialized,"},{"line_number":70,"context_line":"        },"},{"line_number":71,"context_line":"    },"},{"line_number":72,"context_line":"]"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"def locked_driver_event(event):"}],"source_content_type":"text/x-python","patch_set":22,"id":"5f201791_9b98f86a","line":72,"range":{"start_line":49,"start_character":0,"end_line":72,"end_character":1},"in_reply_to":"7f231b9d_9f20e69d","updated":"2017-06-21 09:30:48.000000000","message":"I follow the rule - keep the interface simple. The best interfaces are almost invisible to the user.\n\nIn 99.9% cases transition initialized -\u003e initialized will be used.\n\nAlso event.sync in uninitialized seems possible...","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"8bc643676fac6903f335a665d84b49a0c9fab36e","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    initialized \u003d \u0027initialized\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"class Events(object):"},{"line_number":50,"context_line":"    \"\"\"PXE filter driver transitions.\"\"\""},{"line_number":51,"context_line":"    initialize \u003d \u0027initialize\u0027"},{"line_number":52,"context_line":"    sync \u003d \u0027sync\u0027"},{"line_number":53,"context_line":"    reset \u003d \u0027reset\u0027"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"# a reset is always possible"},{"line_number":57,"context_line":"State_space \u003d ["},{"line_number":58,"context_line":"    {"},{"line_number":59,"context_line":"        \u0027name\u0027: States.uninitialized,"},{"line_number":60,"context_line":"        \u0027next_states\u0027: {"},{"line_number":61,"context_line":"            Events.initialize: States.initialized,"},{"line_number":62,"context_line":"            Events.reset: States.uninitialized,"},{"line_number":63,"context_line":"        },"},{"line_number":64,"context_line":"    },"},{"line_number":65,"context_line":"    {"},{"line_number":66,"context_line":"        \u0027name\u0027: States.initialized,"},{"line_number":67,"context_line":"        \u0027next_states\u0027: {"},{"line_number":68,"context_line":"            Events.sync: States.initialized,"},{"line_number":69,"context_line":"            Events.reset: States.uninitialized,"},{"line_number":70,"context_line":"        },"},{"line_number":71,"context_line":"    },"},{"line_number":72,"context_line":"]"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"def locked_driver_event(event):"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f231b9d_7b62deaf","line":72,"range":{"start_line":49,"start_character":0,"end_line":72,"end_character":1},"in_reply_to":"7f231b9d_cf749300","updated":"2017-06-19 15:58:46.000000000","message":"I thought it was simplifying it actually, separating the state management from the internal driver logic.\n\nAlso allows \"client\" classes to have different state machine while still being able to reuse the base class code or to add e.g an error state in the future...","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"e85a6e8d16ba3ed87547887ff4d068a3db7c70f6","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        self.fsm.process_event(Events.reset)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    @contextlib.contextmanager"},{"line_number":127,"context_line":"    def locked(self):"},{"line_number":128,"context_line":"        \"\"\"Lock the filter driver."},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        ...and ensure the lock is released outside the ctx."}],"source_content_type":"text/x-python","patch_set":22,"id":"7f231b9d_ba15173f","line":127,"range":{"start_line":127,"start_character":8,"end_line":127,"end_character":14},"updated":"2017-06-19 13:36:06.000000000","message":"why do you need this method? It does nothing useful.\nIt could be replaced with:\n\nwith self._lock:\n    do_something_under_the_lock()","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"8bc643676fac6903f335a665d84b49a0c9fab36e","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        self.fsm.process_event(Events.reset)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    @contextlib.contextmanager"},{"line_number":127,"context_line":"    def locked(self):"},{"line_number":128,"context_line":"        \"\"\"Lock the filter driver."},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        ...and ensure the lock is released outside the ctx."}],"source_content_type":"text/x-python","patch_set":22,"id":"7f231b9d_3b7c6670","line":127,"range":{"start_line":127,"start_character":8,"end_line":127,"end_character":14},"in_reply_to":"7f231b9d_ba15173f","updated":"2017-06-19 15:58:46.000000000","message":"right","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ceb19e073b8f9ef4764dd770e16b78c199741723","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            LOG.debug(\u0027The PXE filter driver %s released the lock\u0027, self)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    @contextlib.contextmanager"},{"line_number":141,"context_line":"    def fsm_precautions(self):"},{"line_number":142,"context_line":"        \"\"\"Perform a driver state change."},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        A finite state machine is yielded to process the state change event."}],"source_content_type":"text/x-python","patch_set":22,"id":"7f231b9d_242d45a8","line":141,"range":{"start_line":141,"start_character":8,"end_line":141,"end_character":23},"updated":"2017-06-20 12:24:07.000000000","message":"this should really be called reset_on_exception, as it\u0027s all it does.. and I still wonder if it\u0027s useful enough. You can just as well catch exception in the code that calls the periodic task","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"739ac310c91568f9acb056743f671f05c2d78d2f","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            LOG.debug(\u0027The PXE filter driver %s released the lock\u0027, self)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    @contextlib.contextmanager"},{"line_number":141,"context_line":"    def fsm_precautions(self):"},{"line_number":142,"context_line":"        \"\"\"Perform a driver state change."},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        A finite state machine is yielded to process the state change event."}],"source_content_type":"text/x-python","patch_set":22,"id":"5f201791_48c60b6a","line":141,"range":{"start_line":141,"start_character":8,"end_line":141,"end_character":23},"in_reply_to":"5f201791_bb0a9487","updated":"2017-06-21 13:54:35.000000000","message":"How would you up-call an interface method from a subclass?","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"84b714e611386d5da09afaeb6582ee9521d49396","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            LOG.debug(\u0027The PXE filter driver %s released the lock\u0027, self)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    @contextlib.contextmanager"},{"line_number":141,"context_line":"    def fsm_precautions(self):"},{"line_number":142,"context_line":"        \"\"\"Perform a driver state change."},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        A finite state machine is yielded to process the state change event."}],"source_content_type":"text/x-python","patch_set":22,"id":"7f231b9d_7f862ade","line":141,"range":{"start_line":141,"start_character":8,"end_line":141,"end_character":23},"in_reply_to":"7f231b9d_242d45a8","updated":"2017-06-20 12:45:14.000000000","message":"the original idea was to expose the fsm to the user (subclass overriding a method) in order to avoid the boilerplate of:\n\n  driver.lock.acquire(blocking\u003dTrue)\n  try:\n     \u003cdo state change \u0026 run custom filter code\u003e\n  except \u003cInvalidState\u003e:\n      LOG.error()\n\n  except Exception:\n       driver.reset()\n  finally:\n       driver.lock.release()\n\nThat used to pest the iptables and dnsmasq implementations.\nSo I factored it out into a ctx manager that is reusable both stand-alone and in the decorator, as the driver subclass finds it more appropriate\n\nThe thing with the InvalidState is we\u0027d be resetting the driver even having reset it in another thread; I\u0027d rather avoid that.","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"b07a112e2035b610cb46b3654e98744c3b8e817d","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            LOG.debug(\u0027The PXE filter driver %s released the lock\u0027, self)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    @contextlib.contextmanager"},{"line_number":141,"context_line":"    def fsm_precautions(self):"},{"line_number":142,"context_line":"        \"\"\"Perform a driver state change."},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        A finite state machine is yielded to process the state change event."}],"source_content_type":"text/x-python","patch_set":22,"id":"7f231b9d_9f446676","line":141,"range":{"start_line":141,"start_character":8,"end_line":141,"end_character":23},"in_reply_to":"7f231b9d_7f862ade","updated":"2017-06-20 12:46:52.000000000","message":"I still don\u0027t get why you can\u0027t use one big try..except block, even though you\u0027re going to abort the process on exceptions.","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"70dfc8d77822c984db07bcb27c0917b8d5524af6","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            LOG.debug(\u0027The PXE filter driver %s released the lock\u0027, self)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    @contextlib.contextmanager"},{"line_number":141,"context_line":"    def fsm_precautions(self):"},{"line_number":142,"context_line":"        \"\"\"Perform a driver state change."},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        A finite state machine is yielded to process the state change event."}],"source_content_type":"text/x-python","patch_set":22,"id":"5f201791_bb0a9487","line":141,"range":{"start_line":141,"start_character":8,"end_line":141,"end_character":23},"in_reply_to":"7f231b9d_9f446676","updated":"2017-06-21 09:30:48.000000000","message":"Yeah, that\u0027s why I\u0027d keep interface as simple as possible. And hide all init stuff in base driver","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ceb19e073b8f9ef4764dd770e16b78c199741723","unresolved":false,"context_lines":[{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    @contextlib.contextmanager"},{"line_number":141,"context_line":"    def fsm_precautions(self):"},{"line_number":142,"context_line":"        \"\"\"Perform a driver state change."},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        A finite state machine is yielded to process the state change event."},{"line_number":145,"context_line":"        An exception will trigger self.reset()"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f231b9d_a4127561","line":142,"range":{"start_line":142,"start_character":11,"end_line":142,"end_character":41},"updated":"2017-06-20 12:24:07.000000000","message":"this call itself does not perform any state changes","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"e85a6e8d16ba3ed87547887ff4d068a3db7c70f6","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        try:"},{"line_number":152,"context_line":"            yield self.fsm"},{"line_number":153,"context_line":"        except automaton_errors.NotFound as e:"},{"line_number":154,"context_line":"            raise InvalidFilterDriverState(_(\u0027The PXE filter driver %(driver)s\u0027"},{"line_number":155,"context_line":"                                             \u0027: my fsm encountered an \u0027"},{"line_number":156,"context_line":"                                             \u0027exception: %(error)s\u0027) % {"},{"line_number":157,"context_line":"                                                 \u0027driver\u0027: self, \u0027error\u0027: e})"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f231b9d_7a19bfd4","line":154,"range":{"start_line":154,"start_character":18,"end_line":154,"end_character":42},"updated":"2017-06-19 13:36:06.000000000","message":"it\u0027s treated as bad request, seems wrong.\n\nalso why don\u0027t reset the the filter? it\u0027s breaking error","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"739ac310c91568f9acb056743f671f05c2d78d2f","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        try:"},{"line_number":152,"context_line":"            yield self.fsm"},{"line_number":153,"context_line":"        except automaton_errors.NotFound as e:"},{"line_number":154,"context_line":"            raise InvalidFilterDriverState(_(\u0027The PXE filter driver %(driver)s\u0027"},{"line_number":155,"context_line":"                                             \u0027: my fsm encountered an \u0027"},{"line_number":156,"context_line":"                                             \u0027exception: %(error)s\u0027) % {"},{"line_number":157,"context_line":"                                                 \u0027driver\u0027: self, \u0027error\u0027: e})"}],"source_content_type":"text/x-python","patch_set":22,"id":"5f201791_089a5313","line":154,"range":{"start_line":154,"start_character":18,"end_line":154,"end_character":42},"in_reply_to":"5f201791_db1310b8","updated":"2017-06-21 13:54:35.000000000","message":"No, apart from it being broken (as reset() might be called multiple times then from different threads), we\u0027d better translate the generic automaton error to a driver-specific error.\n\nImagine dnsmasq filter failed to sync due to e.g full disk. We\u0027d be calling reset() twice (systemctl stop devstack@ironic-inspector-dhcp). Less better than more here, no?\n\nWe also should not reset() when e.g syncing an uninitialized driver (which would be a bug in the inspector but) better safe than sorry?","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"70dfc8d77822c984db07bcb27c0917b8d5524af6","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        try:"},{"line_number":152,"context_line":"            yield self.fsm"},{"line_number":153,"context_line":"        except automaton_errors.NotFound as e:"},{"line_number":154,"context_line":"            raise InvalidFilterDriverState(_(\u0027The PXE filter driver %(driver)s\u0027"},{"line_number":155,"context_line":"                                             \u0027: my fsm encountered an \u0027"},{"line_number":156,"context_line":"                                             \u0027exception: %(error)s\u0027) % {"},{"line_number":157,"context_line":"                                                 \u0027driver\u0027: self, \u0027error\u0027: e})"}],"source_content_type":"text/x-python","patch_set":22,"id":"5f201791_db1310b8","line":154,"range":{"start_line":154,"start_character":18,"end_line":154,"end_character":42},"in_reply_to":"7f231b9d_445ba153","updated":"2017-06-21 09:30:48.000000000","message":"+1, should be fine","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"8bc643676fac6903f335a665d84b49a0c9fab36e","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        try:"},{"line_number":152,"context_line":"            yield self.fsm"},{"line_number":153,"context_line":"        except automaton_errors.NotFound as e:"},{"line_number":154,"context_line":"            raise InvalidFilterDriverState(_(\u0027The PXE filter driver %(driver)s\u0027"},{"line_number":155,"context_line":"                                             \u0027: my fsm encountered an \u0027"},{"line_number":156,"context_line":"                                             \u0027exception: %(error)s\u0027) % {"},{"line_number":157,"context_line":"                                                 \u0027driver\u0027: self, \u0027error\u0027: e})"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f231b9d_a07961c5","line":154,"range":{"start_line":154,"start_character":18,"end_line":154,"end_character":42},"in_reply_to":"7f231b9d_7a19bfd4","updated":"2017-06-19 15:58:46.000000000","message":"\u003e it\u0027s treated as bad request, seems wrong.\n\nRight, will make it a RuntimeError subclass instead; should be internal server error sort of thing\n\n\u003e also why don\u0027t reset the the filter? it\u0027s breaking error\n\nThis is equivalent with the \"initializing an initialized\" driver situation; we\u0027d be resetting without \"reason\".","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ceb19e073b8f9ef4764dd770e16b78c199741723","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        try:"},{"line_number":152,"context_line":"            yield self.fsm"},{"line_number":153,"context_line":"        except automaton_errors.NotFound as e:"},{"line_number":154,"context_line":"            raise InvalidFilterDriverState(_(\u0027The PXE filter driver %(driver)s\u0027"},{"line_number":155,"context_line":"                                             \u0027: my fsm encountered an \u0027"},{"line_number":156,"context_line":"                                             \u0027exception: %(error)s\u0027) % {"},{"line_number":157,"context_line":"                                                 \u0027driver\u0027: self, \u0027error\u0027: e})"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f231b9d_445ba153","line":154,"range":{"start_line":154,"start_character":18,"end_line":154,"end_character":42},"in_reply_to":"7f231b9d_a07961c5","updated":"2017-06-20 12:24:07.000000000","message":"I\u0027d just remove this catch and let the next block handle it","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ceb19e073b8f9ef4764dd770e16b78c199741723","unresolved":false,"context_lines":[{"line_number":202,"context_line":"            # a spacing value of (a switched off) periodic"},{"line_number":203,"context_line":"            spacing\u003dCONF.pxe_filter.sync_period or float(\u0027inf\u0027),"},{"line_number":204,"context_line":"            enabled\u003dbool(CONF.pxe_filter.sync_period))("},{"line_number":205,"context_line":"                lambda: self.sync(ironic))"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"class NoopFilter(BaseFilter):"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f231b9d_1fb7363d","line":205,"range":{"start_line":205,"start_character":16,"end_line":205,"end_character":41},"updated":"2017-06-20 12:24:07.000000000","message":"... here is where you could catch exceptions and reset the driver, if needed. I don\u0027t believe fsm_precautions is better than that.","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"84b714e611386d5da09afaeb6582ee9521d49396","unresolved":false,"context_lines":[{"line_number":202,"context_line":"            # a spacing value of (a switched off) periodic"},{"line_number":203,"context_line":"            spacing\u003dCONF.pxe_filter.sync_period or float(\u0027inf\u0027),"},{"line_number":204,"context_line":"            enabled\u003dbool(CONF.pxe_filter.sync_period))("},{"line_number":205,"context_line":"                lambda: self.sync(ironic))"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"class NoopFilter(BaseFilter):"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f231b9d_dfee5e8a","line":205,"range":{"start_line":205,"start_character":16,"end_line":205,"end_character":41},"in_reply_to":"7f231b9d_1fb7363d","updated":"2017-06-20 12:45:14.000000000","message":"yup but one of the goals was to remove the boilerplate try:except:finally blocks","commit_id":"517cc1f60ef3b95dfa7890928201da095af7ab32"}],"ironic_inspector/pxe_filter/interface.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e1d767380674ee6a569a76f3145fed7f6910565d","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":22,"context_line":"class FilterDriver(object):"},{"line_number":23,"context_line":"    \"\"\"The PXE boot filtering interface.\"\"\""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":21,"id":"7f231b9d_8d6aa0b0","line":22,"updated":"2017-06-14 10:00:35.000000000","message":"please move it to base.py, I don\u0027t think this object deserves a file of its own","commit_id":"39b2238460b8166d51bc45461ad3fc73988070b6"}],"ironic_inspector/pxe_filter/iptables.py":[{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"04d75fdc76a0ea86d69368f4d6f5929e40651f32","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"CONF \u003d cfg.CONF"},{"line_number":29,"context_line":"LOG \u003d log.getLogger(\"ironic_inspector.iptables\")"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"_EMAC_REGEX \u003d \u0027EMAC\u003d([0-9a-f]{2}(:[0-9a-f]{2}){5}) IMAC\u003d.*\u0027"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_ed323110","line":29,"range":{"start_line":29,"start_character":20,"end_line":29,"end_character":47},"updated":"2017-05-22 12:48:28.000000000","message":"s/\"ironic_inspector.iptables\"/__name__","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"a5cbc12ff444bd94dbca2dad7c1996d8dfad3c2e","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"CONF \u003d cfg.CONF"},{"line_number":29,"context_line":"LOG \u003d log.getLogger(\"ironic_inspector.iptables\")"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"_EMAC_REGEX \u003d \u0027EMAC\u003d([0-9a-f]{2}(:[0-9a-f]{2}){5}) IMAC\u003d.*\u0027"},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_f0183876","line":29,"range":{"start_line":29,"start_character":20,"end_line":29,"end_character":47},"in_reply_to":"ff0f0b1f_ed323110","updated":"2017-05-29 10:03:00.000000000","message":"Done","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"04d75fdc76a0ea86d69368f4d6f5929e40651f32","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def init_filter(self):"},{"line_number":59,"context_line":"        if self.initialized:"},{"line_number":60,"context_line":"            LOG.warning(\u0027Attempted to initialize an already initialized \u0027"},{"line_number":61,"context_line":"                        \u0027driver\u0027)"},{"line_number":62,"context_line":"            return"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_9024ecb0","line":60,"range":{"start_line":60,"start_character":16,"end_line":60,"end_character":23},"updated":"2017-05-22 12:48:28.000000000","message":"if init_filter is idempotent, I\u0027d change it to `info`","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"a5cbc12ff444bd94dbca2dad7c1996d8dfad3c2e","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def init_filter(self):"},{"line_number":59,"context_line":"        if self.initialized:"},{"line_number":60,"context_line":"            LOG.warning(\u0027Attempted to initialize an already initialized \u0027"},{"line_number":61,"context_line":"                        \u0027driver\u0027)"},{"line_number":62,"context_line":"            return"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_d083f455","line":60,"range":{"start_line":60,"start_character":16,"end_line":60,"end_character":23},"in_reply_to":"ff0f0b1f_9024ecb0","updated":"2017-05-29 10:03:00.000000000","message":"valid concern. On the other hand it might help debugging if something else failed up the stack. Not sure what to do here but I definitely miss a LOG.info at the end of the function.","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"04d75fdc76a0ea86d69368f4d6f5929e40651f32","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        :returns: nothing."},{"line_number":102,"context_line":"        \"\"\""},{"line_number":103,"context_line":"        if not self.initialized:"},{"line_number":104,"context_line":"            LOG.warning(\u0027Attempted to sync a not initialized driver\u0027)"},{"line_number":105,"context_line":"            return"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        with self.lock:"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_704cb841","line":104,"range":{"start_line":104,"start_character":12,"end_line":104,"end_character":69},"updated":"2017-05-22 12:48:28.000000000","message":"I\u0027m wondering if we should be error here since introspection wouldn\u0027t work","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"a5cbc12ff444bd94dbca2dad7c1996d8dfad3c2e","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        :returns: nothing."},{"line_number":102,"context_line":"        \"\"\""},{"line_number":103,"context_line":"        if not self.initialized:"},{"line_number":104,"context_line":"            LOG.warning(\u0027Attempted to sync a not initialized driver\u0027)"},{"line_number":105,"context_line":"            return"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        with self.lock:"}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_b0d6404f","line":104,"range":{"start_line":104,"start_character":12,"end_line":104,"end_character":69},"in_reply_to":"ff0f0b1f_704cb841","updated":"2017-05-29 10:03:00.000000000","message":"Done","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"adf10c631569ce2be7dd9863e1da46a18b33d3a0","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        # iptables"},{"line_number":83,"context_line":"        self._iptables(\u0027-N\u0027, self.chain)"},{"line_number":84,"context_line":"        self.initialized \u003d True"},{"line_number":85,"context_line":"        LOG.info(\u0027The iptables filter was initialized\u0027)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def sync(self, ironic\u003dNone):"},{"line_number":88,"context_line":"        \"\"\"Sync firewall filter rules for introspection."}],"source_content_type":"text/x-python","patch_set":14,"id":"df140735_ef0db735","line":85,"range":{"start_line":85,"start_character":0,"end_line":85,"end_character":55},"updated":"2017-05-31 11:52:18.000000000","message":"I\u0027ll be demoting to LOG.debug to match Dmitry\u0027s concern on the dnsmasq filter patch","commit_id":"41d479ae45fce98a7b4363ac4a88cc8d9d4984ff"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"adf10c631569ce2be7dd9863e1da46a18b33d3a0","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            # Cache result of successful iptables update"},{"line_number":132,"context_line":"            self.enabled \u003d True"},{"line_number":133,"context_line":"            self.blacklist_cache \u003d to_blacklist"},{"line_number":134,"context_line":"        LOG.info(\u0027The iptables filter was synchronized\u0027)"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def tear_down_filter(self):"},{"line_number":137,"context_line":"        if not self.initialized:"}],"source_content_type":"text/x-python","patch_set":14,"id":"df140735_4f09442f","line":134,"range":{"start_line":134,"start_character":7,"end_line":134,"end_character":17},"updated":"2017-05-31 11:52:18.000000000","message":"ditto","commit_id":"41d479ae45fce98a7b4363ac4a88cc8d9d4984ff"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"adf10c631569ce2be7dd9863e1da46a18b33d3a0","unresolved":false,"context_lines":[{"line_number":143,"context_line":"            self._clean_up(self.new_chain)"},{"line_number":144,"context_line":"        finally:"},{"line_number":145,"context_line":"            self.initialized \u003d False"},{"line_number":146,"context_line":"        LOG.info(\u0027The iptables filter was torn down\u0027)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    @contextlib.contextmanager"},{"line_number":149,"context_line":"    def _temporary_chain(self, chain, main_chain):"}],"source_content_type":"text/x-python","patch_set":14,"id":"df140735_2f0ccf39","line":146,"range":{"start_line":146,"start_character":8,"end_line":146,"end_character":17},"updated":"2017-05-31 11:52:18.000000000","message":"ditto","commit_id":"41d479ae45fce98a7b4363ac4a88cc8d9d4984ff"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"9df835fd001ba0fd66193e6b57dbbb5300438e04","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        if self.initialized:"},{"line_number":60,"context_line":"            LOG.warning(\u0027Attempted to initialize an already initialized \u0027"},{"line_number":61,"context_line":"                        \u0027driver\u0027)"},{"line_number":62,"context_line":"            return"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        self.blacklist_cache \u003d None"},{"line_number":65,"context_line":"        self.enabled \u003d True"}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_8967dcb7","line":62,"updated":"2017-06-05 10:15:18.000000000","message":"nit: I wonder if this logic could be moved to the base class","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"f921f69613e64324a176ae28dd402388c3c7b176","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        if self.initialized:"},{"line_number":60,"context_line":"            LOG.warning(\u0027Attempted to initialize an already initialized \u0027"},{"line_number":61,"context_line":"                        \u0027driver\u0027)"},{"line_number":62,"context_line":"            return"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        self.blacklist_cache \u003d None"},{"line_number":65,"context_line":"        self.enabled \u003d True"}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_59486d2b","line":62,"in_reply_to":"df140735_8967dcb7","updated":"2017-06-05 15:40:47.000000000","message":"might imply the locking being handled by the base class, but  may be OK (some special filters might want to override with a distributed lock for instance). Maybe we can have an abstract interface (as a contract) and a generic driver implementation that would handle this in a default way?","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"}],"ironic_inspector/test/functional.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"9df835fd001ba0fd66193e6b57dbbb5300438e04","unresolved":false,"context_lines":[{"line_number":56,"context_line":"[pxe_filter]"},{"line_number":57,"context_line":"driver \u003d noop"},{"line_number":58,"context_line":"[processing]"},{"line_number":59,"context_line":"enable_setting_ipmi_credentials \u003d True"},{"line_number":60,"context_line":"[DEFAULT]"},{"line_number":61,"context_line":"debug \u003d True"},{"line_number":62,"context_line":"auth_strategy \u003d noauth"}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_a96ce09b","line":59,"updated":"2017-06-05 10:15:18.000000000","message":"please remove, this is probably from a merge","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"f921f69613e64324a176ae28dd402388c3c7b176","unresolved":false,"context_lines":[{"line_number":56,"context_line":"[pxe_filter]"},{"line_number":57,"context_line":"driver \u003d noop"},{"line_number":58,"context_line":"[processing]"},{"line_number":59,"context_line":"enable_setting_ipmi_credentials \u003d True"},{"line_number":60,"context_line":"[DEFAULT]"},{"line_number":61,"context_line":"debug \u003d True"},{"line_number":62,"context_line":"auth_strategy \u003d noauth"}],"source_content_type":"text/x-python","patch_set":17,"id":"df140735_7958d186","line":59,"in_reply_to":"df140735_a96ce09b","updated":"2017-06-05 15:40:47.000000000","message":"Done","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"}],"ironic_inspector/test/unit/test_iptables.py":[{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"36857962de70410aba51ee14cee8640ad0cca7f0","unresolved":false,"context_lines":[{"line_number":27,"context_line":"CONF \u003d cfg.CONF"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"@mock.patch.object(ir_utils, \u0027get_client\u0027)"},{"line_number":31,"context_line":"@mock.patch.object(iptables.subprocess, \u0027check_call\u0027)"},{"line_number":32,"context_line":"class TestIptablesDriver(test_base.NodeTest):"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_96f09669","line":31,"range":{"start_line":30,"start_character":0,"end_line":31,"end_character":53},"updated":"2017-05-19 13:44:07.000000000","message":"maybe refactor into fixtures too","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"36857962de70410aba51ee14cee8640ad0cca7f0","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"@mock.patch.object(ir_utils, \u0027get_client\u0027)"},{"line_number":31,"context_line":"@mock.patch.object(iptables.subprocess, \u0027check_call\u0027)"},{"line_number":32,"context_line":"class TestIptablesDriver(test_base.NodeTest):"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def setUp(self):"},{"line_number":35,"context_line":"        super(TestIptablesDriver, self).setUp()"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_16db66ed","line":32,"range":{"start_line":32,"start_character":0,"end_line":32,"end_character":45},"updated":"2017-05-19 13:44:07.000000000","message":"missing self.mock__get_blacklist.assert_called* in the tests","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"}],"ironic_inspector/test/unit/test_main.py":[{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"04d75fdc76a0ea86d69368f4d6f5929e40651f32","unresolved":false,"context_lines":[{"line_number":665,"context_line":""},{"line_number":666,"context_line":"    def tearDown(self):"},{"line_number":667,"context_line":"        self.service.shutdown()"},{"line_number":668,"context_line":"        filter_driver \u003d self.filter_driver_mock.return_value.driver"},{"line_number":669,"context_line":"        filter_driver.tear_down_filter.assert_called_once_with()"},{"line_number":670,"context_line":"        super(TestInit, self).tearDown()"},{"line_number":671,"context_line":""},{"line_number":672,"context_line":"    def test_ok(self, mock_node_cache, mock_get_client, mock_auth):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff0f0b1f_f39c52c1","line":669,"range":{"start_line":668,"start_character":0,"end_line":669,"end_character":64},"updated":"2017-05-22 12:48:28.000000000","message":"nit: ideally tearDown shouldn\u0027t test anything, I\u0027d add explicit test case for tear_down_filter","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"a5cbc12ff444bd94dbca2dad7c1996d8dfad3c2e","unresolved":false,"context_lines":[{"line_number":665,"context_line":""},{"line_number":666,"context_line":"    def tearDown(self):"},{"line_number":667,"context_line":"        self.service.shutdown()"},{"line_number":668,"context_line":"        filter_driver \u003d self.filter_driver_mock.return_value.driver"},{"line_number":669,"context_line":"        filter_driver.tear_down_filter.assert_called_once_with()"},{"line_number":670,"context_line":"        super(TestInit, self).tearDown()"},{"line_number":671,"context_line":""},{"line_number":672,"context_line":"    def test_ok(self, mock_node_cache, mock_get_client, mock_auth):"}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_90821cc8","line":669,"range":{"start_line":668,"start_character":0,"end_line":669,"end_character":64},"in_reply_to":"ff0f0b1f_f39c52c1","updated":"2017-05-29 10:03:00.000000000","message":"Done","commit_id":"532c8cb683a9855af4f4537180bc21d16ede85c2"}],"releasenotes/notes/pxe_filter_driver-c42b65f59c1ee1a7.yaml":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"9df835fd001ba0fd66193e6b57dbbb5300438e04","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    (the default) and a ``noop`` driver implementation."},{"line_number":6,"context_line":"upgrade:"},{"line_number":7,"context_line":"  - |"},{"line_number":8,"context_line":"    The ``firewall`` configuration group was removed."},{"line_number":9,"context_line":"deprecations:"},{"line_number":10,"context_line":"  - |"},{"line_number":11,"context_line":"    The firewall-specific configuration options were renamed to ``iptables``."}],"source_content_type":"text/x-yaml","patch_set":17,"id":"df140735_e9765870","line":8,"updated":"2017-06-05 10:15:18.000000000","message":"this is not entirely true, it was deprecated, not removed","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"},{"author":{"_account_id":18653,"name":"Milan Kováčik","email":"mkovacik@redhat.com","username":"dparalen"},"change_message_id":"f921f69613e64324a176ae28dd402388c3c7b176","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    (the default) and a ``noop`` driver implementation."},{"line_number":6,"context_line":"upgrade:"},{"line_number":7,"context_line":"  - |"},{"line_number":8,"context_line":"    The ``firewall`` configuration group was removed."},{"line_number":9,"context_line":"deprecations:"},{"line_number":10,"context_line":"  - |"},{"line_number":11,"context_line":"    The firewall-specific configuration options were renamed to ``iptables``."}],"source_content_type":"text/x-yaml","patch_set":17,"id":"df140735_d9c35dec","line":8,"in_reply_to":"df140735_e9765870","updated":"2017-06-05 15:40:47.000000000","message":"Done","commit_id":"b885f89a3c54dde6601b60a4c05bc123ce7a3f9f"}]}
