)]}'
{"nova/virt/powervm/driver.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"04f9189a4207dbd569b7dabe66aed6c2088c8114","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        self._initialized \u003d True"},{"line_number":104,"context_line":"        LOG.info(\"The PowerVM compute driver has been initialized.\")"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def _set_host_enabled(self, enabled):"},{"line_number":107,"context_line":"        \"\"\"Sets the compute host\u0027s ability to accept new instances.\"\"\""},{"line_number":108,"context_line":"        adm_ctx \u003d ctx.get_admin_context()"},{"line_number":109,"context_line":"        service \u003d objects.Service.get_by_compute_host(adm_ctx, CONF.host)"},{"line_number":110,"context_line":"        service.disabled \u003d not enabled"},{"line_number":111,"context_line":"        service.disabled_reason \u003d \u0027set by powervm driver\u0027"},{"line_number":112,"context_line":"        service.save()"},{"line_number":113,"context_line":"        if service.disabled:"},{"line_number":114,"context_line":"            LOG.warning(\"The compute service has been auto-disabled.\")"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    @staticmethod"},{"line_number":117,"context_line":"    def _log_operation(op, instance):"}],"source_content_type":"text/x-python","patch_set":2,"id":"df140735_63c68419","line":114,"range":{"start_line":106,"start_character":0,"end_line":114,"end_character":70},"updated":"2017-06-07 19:11:32.000000000","message":"I would like to get this factored out into a ComputeDriver base method, since PowerVM will now be (at least) the third driver using it.  (Also nova.compute.manager.ComputeManager#_build_failed)","commit_id":"d15399723cd099701e9a180fca2d6582ed407e03"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"66a9ed7a31af3ef5f39189eb02bbf175ebbe1c6c","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        Includes catching up with currently running VMs on the given host."},{"line_number":63,"context_line":"        \"\"\""},{"line_number":64,"context_line":"        self.image_api \u003d image.API()"},{"line_number":65,"context_line":"        self._check_and_init_host(force_init\u003dTrue)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def _check_and_init_host(self, force_init\u003dFalse):"},{"line_number":68,"context_line":"        _initialized_at_entry \u003d self._initialized"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_631e73bb","line":65,"range":{"start_line":65,"start_character":34,"end_line":65,"end_character":49},"updated":"2017-06-12 19:54:49.000000000","message":"This shouldn\u0027t be necessary.  init_host gets called just once, on driver startup, so adapter/_initialized will definitely be None/False.  Is there somewhere else you were using force_init\u003dTrue?  I\u0027m not seeing it.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"90a1ef952810e999e04359484f367fcc334eebfb","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        Includes catching up with currently running VMs on the given host."},{"line_number":63,"context_line":"        \"\"\""},{"line_number":64,"context_line":"        self.image_api \u003d image.API()"},{"line_number":65,"context_line":"        self._check_and_init_host(force_init\u003dTrue)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def _check_and_init_host(self, force_init\u003dFalse):"},{"line_number":68,"context_line":"        _initialized_at_entry \u003d self._initialized"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_651bf480","line":65,"range":{"start_line":65,"start_character":34,"end_line":65,"end_character":49},"in_reply_to":"7f231b9d_631e73bb","updated":"2017-06-13 20:47:22.000000000","message":"right, I\u0027m not aware of any other places, but I thought this was safer in case I missed something or it gets called more in future. Doesn\u0027t hurt anything if it\u0027s not.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"04ebf6927a7e72eb775bc90fe9c09374b0d6c3f0","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        Includes catching up with currently running VMs on the given host."},{"line_number":63,"context_line":"        \"\"\""},{"line_number":64,"context_line":"        self.image_api \u003d image.API()"},{"line_number":65,"context_line":"        self._check_and_init_host(force_init\u003dTrue)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def _check_and_init_host(self, force_init\u003dFalse):"},{"line_number":68,"context_line":"        _initialized_at_entry \u003d self._initialized"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_6c03d810","line":65,"range":{"start_line":65,"start_character":34,"end_line":65,"end_character":49},"in_reply_to":"7f231b9d_651bf480","updated":"2017-06-13 22:07:23.000000000","message":"We\u0027ve got a general policy of not implementing something that\u0027s not used right now.  We can add it later if it\u0027s needed; at the moment, just take it out.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"1128cf8be6da7952cb912591c7571fd65716fd3d","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        Includes catching up with currently running VMs on the given host."},{"line_number":63,"context_line":"        \"\"\""},{"line_number":64,"context_line":"        self.image_api \u003d image.API()"},{"line_number":65,"context_line":"        self._check_and_init_host(force_init\u003dTrue)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def _check_and_init_host(self, force_init\u003dFalse):"},{"line_number":68,"context_line":"        _initialized_at_entry \u003d self._initialized"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_006e232e","line":65,"range":{"start_line":65,"start_character":34,"end_line":65,"end_character":49},"in_reply_to":"7f231b9d_6c03d810","updated":"2017-06-15 18:39:35.000000000","message":"I was looking at this as more of a safety thing, we don\u0027t break if nova changes how they call this... but I\u0027ll pull it.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"66a9ed7a31af3ef5f39189eb02bbf175ebbe1c6c","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        self.image_api \u003d image.API()"},{"line_number":65,"context_line":"        self._check_and_init_host(force_init\u003dTrue)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def _check_and_init_host(self, force_init\u003dFalse):"},{"line_number":68,"context_line":"        _initialized_at_entry \u003d self._initialized"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        if force_init:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_c8ae86e6","line":67,"updated":"2017-06-12 19:54:49.000000000","message":"This method is tough to read through.  I\u0027m hoping we can refactor/simplify it so it\u0027s not as confusing.\n\nAlso, if it\u0027s gonna be more than a couple of lines, I\u0027d like to move it to host.py to keep driver.py as clean as possible.\n\n[Later] Having looked it over, I think the synthesis of most of my commentary is something like:\n\n def _check_and_init_host(self):\n     try:\n         # If never initted, or previously marked down, bootstrap\n         if not self.adapter:\n             self.adapter \u003d Adapter(...)\n             validate_vios_ready(...)\n             ComprehensiveScrub(...)\n\n         # This should only happen if never initted\n         if not self.disk_dvr:\n             self.disk_dvr \u003d SSPDiskAdapter(...)\n\n         # Check this every time\n         self.host_wrapper \u003d System.get(...)\n\n         # If we got this far, we\u0027re good to go\n         utils.set_host_enabled(True)\n\n     except ThingsThatIndicateRESTIsDown:\n         LOG.exception(...)\n         self.adapter \u003d None\n         utils.set_host_enabled(False, reason\u003d\"The PowerVM API is not available.\")\n\n     return bool(self.adapter)","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"04ebf6927a7e72eb775bc90fe9c09374b0d6c3f0","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        self.image_api \u003d image.API()"},{"line_number":65,"context_line":"        self._check_and_init_host(force_init\u003dTrue)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def _check_and_init_host(self, force_init\u003dFalse):"},{"line_number":68,"context_line":"        _initialized_at_entry \u003d self._initialized"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        if force_init:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_ff0f8cde","line":67,"in_reply_to":"7f231b9d_b6c0247d","updated":"2017-06-13 22:07:23.000000000","message":"Will do.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"90a1ef952810e999e04359484f367fcc334eebfb","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        self.image_api \u003d image.API()"},{"line_number":65,"context_line":"        self._check_and_init_host(force_init\u003dTrue)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def _check_and_init_host(self, force_init\u003dFalse):"},{"line_number":68,"context_line":"        _initialized_at_entry \u003d self._initialized"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        if force_init:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_b6c0247d","line":67,"in_reply_to":"7f231b9d_c8ae86e6","updated":"2017-06-13 20:47:22.000000000","message":"There are some issues with the logic you suggest. I can do some of this. Let me know what you think of the next patch set, and we can dive into more detail there as needed.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"66a9ed7a31af3ef5f39189eb02bbf175ebbe1c6c","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                self.host_wrapper \u003d pvm_ms.System.get(self.adapter)[0]"},{"line_number":80,"context_line":"            except pvm_exc.ConnectionError:"},{"line_number":81,"context_line":"                LOG.warning(\u0027Lost connection to NovaLink\u0027)"},{"line_number":82,"context_line":"                self.adapter \u003d None"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        if not self.adapter:"},{"line_number":85,"context_line":"            # Build an adapter if we don\u0027t already have one."}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_83fd0f3c","line":82,"range":{"start_line":82,"start_character":16,"end_line":82,"end_character":35},"updated":"2017-06-12 19:54:49.000000000","message":"Wondering if we can just use self.adapter \u003d\u003d None as the indicator for !self._initialized.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"04ebf6927a7e72eb775bc90fe9c09374b0d6c3f0","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                self.host_wrapper \u003d pvm_ms.System.get(self.adapter)[0]"},{"line_number":80,"context_line":"            except pvm_exc.ConnectionError:"},{"line_number":81,"context_line":"                LOG.warning(\u0027Lost connection to NovaLink\u0027)"},{"line_number":82,"context_line":"                self.adapter \u003d None"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        if not self.adapter:"},{"line_number":85,"context_line":"            # Build an adapter if we don\u0027t already have one."}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_ff22eca3","line":82,"range":{"start_line":82,"start_character":16,"end_line":82,"end_character":35},"in_reply_to":"7f231b9d_28583330","updated":"2017-06-13 22:07:23.000000000","message":"I\u0027m okay re-getting the adapter in that situation.  That\u0027s cheap, and worth the saved logic.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"90a1ef952810e999e04359484f367fcc334eebfb","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                self.host_wrapper \u003d pvm_ms.System.get(self.adapter)[0]"},{"line_number":80,"context_line":"            except pvm_exc.ConnectionError:"},{"line_number":81,"context_line":"                LOG.warning(\u0027Lost connection to NovaLink\u0027)"},{"line_number":82,"context_line":"                self.adapter \u003d None"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        if not self.adapter:"},{"line_number":85,"context_line":"            # Build an adapter if we don\u0027t already have one."}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_28583330","line":82,"range":{"start_line":82,"start_character":16,"end_line":82,"end_character":35},"in_reply_to":"7f231b9d_83fd0f3c","updated":"2017-06-13 20:47:22.000000000","message":"no, because of the case where we\u0027re able to get an adapter but there aren\u0027t any VIOS ready.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"1128cf8be6da7952cb912591c7571fd65716fd3d","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                self.host_wrapper \u003d pvm_ms.System.get(self.adapter)[0]"},{"line_number":80,"context_line":"            except pvm_exc.ConnectionError:"},{"line_number":81,"context_line":"                LOG.warning(\u0027Lost connection to NovaLink\u0027)"},{"line_number":82,"context_line":"                self.adapter \u003d None"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        if not self.adapter:"},{"line_number":85,"context_line":"            # Build an adapter if we don\u0027t already have one."}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_40809bbf","line":82,"range":{"start_line":82,"start_character":16,"end_line":82,"end_character":35},"in_reply_to":"7f231b9d_ff22eca3","updated":"2017-06-15 18:39:35.000000000","message":"I thought there were negative implications to creating a new Session if we didn\u0027t really need to, but maybe that\u0027s all been resolved... ok.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"66a9ed7a31af3ef5f39189eb02bbf175ebbe1c6c","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                LOG.warning(\u0027Lost connection to NovaLink\u0027)"},{"line_number":82,"context_line":"                self.adapter \u003d None"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        if not self.adapter:"},{"line_number":85,"context_line":"            # Build an adapter if we don\u0027t already have one."},{"line_number":86,"context_line":"            # Handles both initial connect and re-connect cases."},{"line_number":87,"context_line":"            if not self.adapter:"},{"line_number":88,"context_line":"                try:"},{"line_number":89,"context_line":"                    self.adapter \u003d pvm_apt.Adapter("},{"line_number":90,"context_line":"                        helpers\u003d[log_hlp.log_helper,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_25364305","line":87,"range":{"start_line":84,"start_character":0,"end_line":87,"end_character":32},"updated":"2017-06-12 19:54:49.000000000","message":"redundant","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"90a1ef952810e999e04359484f367fcc334eebfb","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                LOG.warning(\u0027Lost connection to NovaLink\u0027)"},{"line_number":82,"context_line":"                self.adapter \u003d None"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        if not self.adapter:"},{"line_number":85,"context_line":"            # Build an adapter if we don\u0027t already have one."},{"line_number":86,"context_line":"            # Handles both initial connect and re-connect cases."},{"line_number":87,"context_line":"            if not self.adapter:"},{"line_number":88,"context_line":"                try:"},{"line_number":89,"context_line":"                    self.adapter \u003d pvm_apt.Adapter("},{"line_number":90,"context_line":"                        helpers\u003d[log_hlp.log_helper,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_a86443e5","line":87,"range":{"start_line":84,"start_character":0,"end_line":87,"end_character":32},"in_reply_to":"7f231b9d_25364305","updated":"2017-06-13 20:47:22.000000000","message":"doh! Yeah, I\u0027ll definitely fix that.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"66a9ed7a31af3ef5f39189eb02bbf175ebbe1c6c","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        try:"},{"line_number":99,"context_line":"            # Make sure at least one Virtual I/O Server is available."},{"line_number":100,"context_line":"            pvm_par.validate_vios_ready(self.adapter, max_wait_time\u003d0)"},{"line_number":101,"context_line":"        except pvm_exc.ViosNotAvailable:"},{"line_number":102,"context_line":"            if _initialized_at_entry:"},{"line_number":103,"context_line":"                LOG.warning(\u0027Lost available Virtual I/O Server\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_e3bcc36a","line":100,"range":{"start_line":100,"start_character":20,"end_line":100,"end_character":39},"updated":"2017-06-12 19:54:49.000000000","message":"This is kind of expensive to have to do every periodic_task_interval.  Thinking we should limit it to only when we need to build the Adapter.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"04ebf6927a7e72eb775bc90fe9c09374b0d6c3f0","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        try:"},{"line_number":99,"context_line":"            # Make sure at least one Virtual I/O Server is available."},{"line_number":100,"context_line":"            pvm_par.validate_vios_ready(self.adapter, max_wait_time\u003d0)"},{"line_number":101,"context_line":"        except pvm_exc.ViosNotAvailable:"},{"line_number":102,"context_line":"            if _initialized_at_entry:"},{"line_number":103,"context_line":"                LOG.warning(\u0027Lost available Virtual I/O Server\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_bf6a34b0","line":100,"range":{"start_line":100,"start_character":20,"end_line":100,"end_character":39},"in_reply_to":"7f231b9d_68618ba9","updated":"2017-06-13 22:07:23.000000000","message":"Best case, it\u0027s a VIOS feed GET with no xags, which is a fair-sized XML dump across the wire.  Worst case, one or more of the VIOSes is busy (or BUSY) and that GET takes a long time even though we would ultimately report \u0027VIOS ready\u0027.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"1128cf8be6da7952cb912591c7571fd65716fd3d","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        try:"},{"line_number":99,"context_line":"            # Make sure at least one Virtual I/O Server is available."},{"line_number":100,"context_line":"            pvm_par.validate_vios_ready(self.adapter, max_wait_time\u003d0)"},{"line_number":101,"context_line":"        except pvm_exc.ViosNotAvailable:"},{"line_number":102,"context_line":"            if _initialized_at_entry:"},{"line_number":103,"context_line":"                LOG.warning(\u0027Lost available Virtual I/O Server\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_409c1b0d","line":100,"range":{"start_line":100,"start_character":20,"end_line":100,"end_character":39},"in_reply_to":"7f231b9d_bf6a34b0","updated":"2017-06-15 18:39:35.000000000","message":"that\u0027s extremely unfortunate... ok","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"90a1ef952810e999e04359484f367fcc334eebfb","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        try:"},{"line_number":99,"context_line":"            # Make sure at least one Virtual I/O Server is available."},{"line_number":100,"context_line":"            pvm_par.validate_vios_ready(self.adapter, max_wait_time\u003d0)"},{"line_number":101,"context_line":"        except pvm_exc.ViosNotAvailable:"},{"line_number":102,"context_line":"            if _initialized_at_entry:"},{"line_number":103,"context_line":"                LOG.warning(\u0027Lost available Virtual I/O Server\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_68618ba9","line":100,"range":{"start_line":100,"start_character":20,"end_line":100,"end_character":39},"in_reply_to":"7f231b9d_e3bcc36a","updated":"2017-06-13 20:47:22.000000000","message":"is it still expensive given that I dropped max_wait_time down to 0? If so, anything we can do to make it less expensive? I like checking this on every run, so that if VIOS goes down that will be reflected in the service state.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"66a9ed7a31af3ef5f39189eb02bbf175ebbe1c6c","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                LOG.warning(\u0027No available Virtual I/O Server\u0027)"},{"line_number":107,"context_line":"            return False"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        if not _initialized_at_entry:"},{"line_number":110,"context_line":"            # Scrub the I/O plane to make sure the system is in good shape"},{"line_number":111,"context_line":"            LOG.info(\"Clearing stale I/O connections on driver init.\")"},{"line_number":112,"context_line":"            pvm_stor.ComprehensiveScrub(self.adapter).execute()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_23519b37","line":109,"range":{"start_line":109,"start_character":0,"end_line":109,"end_character":37},"updated":"2017-06-12 19:54:49.000000000","message":"This is also arguably reasonable to do whenever we have to rebuild the Adapter.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"90a1ef952810e999e04359484f367fcc334eebfb","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                LOG.warning(\u0027No available Virtual I/O Server\u0027)"},{"line_number":107,"context_line":"            return False"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        if not _initialized_at_entry:"},{"line_number":110,"context_line":"            # Scrub the I/O plane to make sure the system is in good shape"},{"line_number":111,"context_line":"            LOG.info(\"Clearing stale I/O connections on driver init.\")"},{"line_number":112,"context_line":"            pvm_stor.ComprehensiveScrub(self.adapter).execute()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_48c00f51","line":109,"range":{"start_line":109,"start_character":0,"end_line":109,"end_character":37},"in_reply_to":"7f231b9d_23519b37","updated":"2017-06-13 20:47:22.000000000","message":"yeah, that\u0027s a good point. If adapter changes, then things that were given the old adapter need to be rebuilt to use the new adapter.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"04ebf6927a7e72eb775bc90fe9c09374b0d6c3f0","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                LOG.warning(\u0027No available Virtual I/O Server\u0027)"},{"line_number":107,"context_line":"            return False"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        if not _initialized_at_entry:"},{"line_number":110,"context_line":"            # Scrub the I/O plane to make sure the system is in good shape"},{"line_number":111,"context_line":"            LOG.info(\"Clearing stale I/O connections on driver init.\")"},{"line_number":112,"context_line":"            pvm_stor.ComprehensiveScrub(self.adapter).execute()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_5f8d6079","line":109,"range":{"start_line":109,"start_character":0,"end_line":109,"end_character":37},"in_reply_to":"7f231b9d_48c00f51","updated":"2017-06-13 22:07:23.000000000","message":"Well, more to the point, if we have to rebuild the Adapter, it could very well be because the REST server tanked in the middle of an operation, which operation might have involved SCSI mappings, which tankage might have left some stale stuff lying around.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"1128cf8be6da7952cb912591c7571fd65716fd3d","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                LOG.warning(\u0027No available Virtual I/O Server\u0027)"},{"line_number":107,"context_line":"            return False"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        if not _initialized_at_entry:"},{"line_number":110,"context_line":"            # Scrub the I/O plane to make sure the system is in good shape"},{"line_number":111,"context_line":"            LOG.info(\"Clearing stale I/O connections on driver init.\")"},{"line_number":112,"context_line":"            pvm_stor.ComprehensiveScrub(self.adapter).execute()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_c02b8b92","line":109,"range":{"start_line":109,"start_character":0,"end_line":109,"end_character":37},"in_reply_to":"7f231b9d_5f8d6079","updated":"2017-06-15 18:39:35.000000000","message":"sure... there\u0027s more than one reason.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"66a9ed7a31af3ef5f39189eb02bbf175ebbe1c6c","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        if not _initialized_at_entry:"},{"line_number":110,"context_line":"            # Scrub the I/O plane to make sure the system is in good shape"},{"line_number":111,"context_line":"            LOG.info(\"Clearing stale I/O connections on driver init.\")"},{"line_number":112,"context_line":"            pvm_stor.ComprehensiveScrub(self.adapter).execute()"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"            # Initialize the disk adapter"},{"line_number":115,"context_line":"            # TODO(efried): Other disk adapters (localdisk), by conf selection."},{"line_number":116,"context_line":"            self.disk_dvr \u003d ssp.SSPDiskAdapter(self.adapter,"},{"line_number":117,"context_line":"                                               self.host_wrapper.uuid)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"            self._set_host_enabled(True)"},{"line_number":120,"context_line":"            LOG.info(\"The PowerVM compute driver has been initialized.\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_1e04b814","line":117,"range":{"start_line":112,"start_character":0,"end_line":117,"end_character":70},"updated":"2017-06-12 19:54:49.000000000","message":"It would be nice if we could catch a certain class of errors from these guys (at least \u0027Serivce Unavailable\u0027) and use those to trigger _set_host_enabled(False) rather than raising them up and bailing on the driver.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"90a1ef952810e999e04359484f367fcc334eebfb","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        if not _initialized_at_entry:"},{"line_number":110,"context_line":"            # Scrub the I/O plane to make sure the system is in good shape"},{"line_number":111,"context_line":"            LOG.info(\"Clearing stale I/O connections on driver init.\")"},{"line_number":112,"context_line":"            pvm_stor.ComprehensiveScrub(self.adapter).execute()"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"            # Initialize the disk adapter"},{"line_number":115,"context_line":"            # TODO(efried): Other disk adapters (localdisk), by conf selection."},{"line_number":116,"context_line":"            self.disk_dvr \u003d ssp.SSPDiskAdapter(self.adapter,"},{"line_number":117,"context_line":"                                               self.host_wrapper.uuid)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"            self._set_host_enabled(True)"},{"line_number":120,"context_line":"            LOG.info(\"The PowerVM compute driver has been initialized.\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_48e12fd0","line":117,"range":{"start_line":112,"start_character":0,"end_line":117,"end_character":70},"in_reply_to":"7f231b9d_1e04b814","updated":"2017-06-13 20:47:22.000000000","message":"we\u0027ve just checked things above, but sure, errors are still possible. Which ones, exactly, I\u0027m not sure. Might need some help figuring out which ones to expect here.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"04ebf6927a7e72eb775bc90fe9c09374b0d6c3f0","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        if not _initialized_at_entry:"},{"line_number":110,"context_line":"            # Scrub the I/O plane to make sure the system is in good shape"},{"line_number":111,"context_line":"            LOG.info(\"Clearing stale I/O connections on driver init.\")"},{"line_number":112,"context_line":"            pvm_stor.ComprehensiveScrub(self.adapter).execute()"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"            # Initialize the disk adapter"},{"line_number":115,"context_line":"            # TODO(efried): Other disk adapters (localdisk), by conf selection."},{"line_number":116,"context_line":"            self.disk_dvr \u003d ssp.SSPDiskAdapter(self.adapter,"},{"line_number":117,"context_line":"                                               self.host_wrapper.uuid)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"            self._set_host_enabled(True)"},{"line_number":120,"context_line":"            LOG.info(\"The PowerVM compute driver has been initialized.\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_dfcf30ae","line":117,"range":{"start_line":112,"start_character":0,"end_line":117,"end_character":70},"in_reply_to":"7f231b9d_48e12fd0","updated":"2017-06-13 22:07:23.000000000","message":"Yeah, so including all of this in a single try/except pretty much covers you there.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"1128cf8be6da7952cb912591c7571fd65716fd3d","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        if not _initialized_at_entry:"},{"line_number":110,"context_line":"            # Scrub the I/O plane to make sure the system is in good shape"},{"line_number":111,"context_line":"            LOG.info(\"Clearing stale I/O connections on driver init.\")"},{"line_number":112,"context_line":"            pvm_stor.ComprehensiveScrub(self.adapter).execute()"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"            # Initialize the disk adapter"},{"line_number":115,"context_line":"            # TODO(efried): Other disk adapters (localdisk), by conf selection."},{"line_number":116,"context_line":"            self.disk_dvr \u003d ssp.SSPDiskAdapter(self.adapter,"},{"line_number":117,"context_line":"                                               self.host_wrapper.uuid)"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"            self._set_host_enabled(True)"},{"line_number":120,"context_line":"            LOG.info(\"The PowerVM compute driver has been initialized.\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_5b053010","line":117,"range":{"start_line":112,"start_character":0,"end_line":117,"end_character":70},"in_reply_to":"7f231b9d_dfcf30ae","updated":"2017-06-15 18:39:35.000000000","message":"only if we catch the right types of exceptions. I think there are probably more to worry about than what I have in the latest patch set, but I\u0027m not sure which ones...","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"66a9ed7a31af3ef5f39189eb02bbf175ebbe1c6c","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        return True"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _set_host_enabled(self, enabled):"},{"line_number":125,"context_line":"        \"\"\"Sets the compute host\u0027s ability to accept new instances.\"\"\""},{"line_number":126,"context_line":"        adm_ctx \u003d ctx.get_admin_context()"},{"line_number":127,"context_line":"        service \u003d objects.Service.get_by_compute_host(adm_ctx, CONF.host)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_e80dc237","line":124,"updated":"2017-06-12 19:54:49.000000000","message":"Still want to see this factored out into a util method.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"1128cf8be6da7952cb912591c7571fd65716fd3d","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        return True"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _set_host_enabled(self, enabled):"},{"line_number":125,"context_line":"        \"\"\"Sets the compute host\u0027s ability to accept new instances.\"\"\""},{"line_number":126,"context_line":"        adm_ctx \u003d ctx.get_admin_context()"},{"line_number":127,"context_line":"        service \u003d objects.Service.get_by_compute_host(adm_ctx, CONF.host)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_d67b5525","line":124,"in_reply_to":"7f231b9d_1f3b689c","updated":"2017-06-15 18:39:35.000000000","message":"you\u0027ve asked me to rebase this onto two different and unrelated things. I don\u0027t think that\u0027s possible. One or the other, until one of them merges and the other is rebased onto it.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"04ebf6927a7e72eb775bc90fe9c09374b0d6c3f0","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        return True"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _set_host_enabled(self, enabled):"},{"line_number":125,"context_line":"        \"\"\"Sets the compute host\u0027s ability to accept new instances.\"\"\""},{"line_number":126,"context_line":"        adm_ctx \u003d ctx.get_admin_context()"},{"line_number":127,"context_line":"        service \u003d objects.Service.get_by_compute_host(adm_ctx, CONF.host)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_1f3b689c","line":124,"in_reply_to":"7f231b9d_480a4f8a","updated":"2017-06-13 22:07:23.000000000","message":"Cool, so let\u0027s rebase this one on top of that one.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"90a1ef952810e999e04359484f367fcc334eebfb","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        return True"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _set_host_enabled(self, enabled):"},{"line_number":125,"context_line":"        \"\"\"Sets the compute host\u0027s ability to accept new instances.\"\"\""},{"line_number":126,"context_line":"        adm_ctx \u003d ctx.get_admin_context()"},{"line_number":127,"context_line":"        service \u003d objects.Service.get_by_compute_host(adm_ctx, CONF.host)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_480a4f8a","line":124,"in_reply_to":"7f231b9d_e80dc237","updated":"2017-06-13 20:47:22.000000000","message":"Yeah, working on that under https://review.openstack.org/#/c/472794/","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"66a9ed7a31af3ef5f39189eb02bbf175ebbe1c6c","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        service.save()"},{"line_number":131,"context_line":"        if service.disabled:"},{"line_number":132,"context_line":"            LOG.warning(\"The compute service has been auto-disabled.\")"},{"line_number":133,"context_line":"        self._initialized \u003d enabled"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    @staticmethod"},{"line_number":136,"context_line":"    def _log_operation(op, instance):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_08091e2b","line":133,"updated":"2017-06-12 19:54:49.000000000","message":"This should be done in the calling context, even at the expense of possibly code duplication.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"90a1ef952810e999e04359484f367fcc334eebfb","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        service.save()"},{"line_number":131,"context_line":"        if service.disabled:"},{"line_number":132,"context_line":"            LOG.warning(\"The compute service has been auto-disabled.\")"},{"line_number":133,"context_line":"        self._initialized \u003d enabled"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    @staticmethod"},{"line_number":136,"context_line":"    def _log_operation(op, instance):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_a850c35e","line":133,"in_reply_to":"7f231b9d_08091e2b","updated":"2017-06-13 20:47:22.000000000","message":"huh?","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"1128cf8be6da7952cb912591c7571fd65716fd3d","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        service.save()"},{"line_number":131,"context_line":"        if service.disabled:"},{"line_number":132,"context_line":"            LOG.warning(\"The compute service has been auto-disabled.\")"},{"line_number":133,"context_line":"        self._initialized \u003d enabled"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    @staticmethod"},{"line_number":136,"context_line":"    def _log_operation(op, instance):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_36a8498a","line":133,"in_reply_to":"7f231b9d_3f6184aa","updated":"2017-06-15 18:39:35.000000000","message":"Done","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"04ebf6927a7e72eb775bc90fe9c09374b0d6c3f0","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        service.save()"},{"line_number":131,"context_line":"        if service.disabled:"},{"line_number":132,"context_line":"            LOG.warning(\"The compute service has been auto-disabled.\")"},{"line_number":133,"context_line":"        self._initialized \u003d enabled"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    @staticmethod"},{"line_number":136,"context_line":"    def _log_operation(op, instance):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_3f6184aa","line":133,"in_reply_to":"7f231b9d_a850c35e","updated":"2017-06-13 22:07:23.000000000","message":"I\u0027m saying `self._initialized \u003d enabled` should be done outside of _set_host_enabled.  But I don\u0027t think self._initialized should exist anyway (see above).","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"66a9ed7a31af3ef5f39189eb02bbf175ebbe1c6c","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        [hypervisor_hostname]."},{"line_number":172,"context_line":"        \"\"\""},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        return [CONF.host]"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def get_available_resource(self, nodename):"},{"line_number":177,"context_line":"        \"\"\"Retrieve resource information."}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_e5716be2","line":174,"range":{"start_line":174,"start_character":16,"end_line":174,"end_character":25},"updated":"2017-06-12 19:54:49.000000000","message":"I don\u0027t like this being buried in this otherwise-almost-unrelated rework.  Let\u0027s put this in a separate change set where we can explain it clearly.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"04ebf6927a7e72eb775bc90fe9c09374b0d6c3f0","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        [hypervisor_hostname]."},{"line_number":172,"context_line":"        \"\"\""},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        return [CONF.host]"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def get_available_resource(self, nodename):"},{"line_number":177,"context_line":"        \"\"\"Retrieve resource information."}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_df5df0e9","line":174,"range":{"start_line":174,"start_character":16,"end_line":174,"end_character":25},"in_reply_to":"7f231b9d_376e4e01","updated":"2017-06-13 22:07:23.000000000","message":"Cool, so rebase this change on top of that one.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"1128cf8be6da7952cb912591c7571fd65716fd3d","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        [hypervisor_hostname]."},{"line_number":172,"context_line":"        \"\"\""},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        return [CONF.host]"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def get_available_resource(self, nodename):"},{"line_number":177,"context_line":"        \"\"\"Retrieve resource information."}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_7b77cca1","line":174,"range":{"start_line":174,"start_character":16,"end_line":174,"end_character":25},"in_reply_to":"7f231b9d_df5df0e9","updated":"2017-06-15 18:39:35.000000000","message":"you\u0027ve asked me to rebase this onto two different and unrelated things. I don\u0027t think that\u0027s possible. One or the other, until one of them merges and the other is rebased onto it.","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"90a1ef952810e999e04359484f367fcc334eebfb","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        [hypervisor_hostname]."},{"line_number":172,"context_line":"        \"\"\""},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        return [CONF.host]"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def get_available_resource(self, nodename):"},{"line_number":177,"context_line":"        \"\"\"Retrieve resource information."}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_376e4e01","line":174,"range":{"start_line":174,"start_character":16,"end_line":174,"end_character":25},"in_reply_to":"7f231b9d_e5716be2","updated":"2017-06-13 20:47:22.000000000","message":"yep... split out to https://review.openstack.org/#/c/473975/","commit_id":"0127859ec5f09a0ab7208ebdd1ad3aadf71a7295"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"203cf6a2f50593fd890c8e0960949ac08f658e12","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        if self.adapter:"},{"line_number":73,"context_line":"            try:"},{"line_number":74,"context_line":"                self.host_wrapper \u003d pvm_ms.System.get(self.adapter)[0]"},{"line_number":75,"context_line":"            except pvm_exc.ConnectionError:"},{"line_number":76,"context_line":"                LOG.warning(\u0027Lost connection to NovaLink\u0027)"},{"line_number":77,"context_line":"                self.adapter \u003d None  # so we will recreate below"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_8c3829ee","line":75,"range":{"start_line":75,"start_character":27,"end_line":75,"end_character":42},"updated":"2017-06-15 22:08:57.000000000","message":"We also see 404 (pvm_exc.HttpNotFound) for a while between when the REST service starts accepting connections and when the servlet is all the way up.  There should be no other legitimate 404 coming from anything in here, so you should be able to add it anywhere you\u0027re using ConnectionError.","commit_id":"503041369c7770ce90a2ba0376fa46eae45ca77c"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"58ee081816993d684800428ff464ee0876bd2fbc","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        if self.adapter:"},{"line_number":73,"context_line":"            try:"},{"line_number":74,"context_line":"                self.host_wrapper \u003d pvm_ms.System.get(self.adapter)[0]"},{"line_number":75,"context_line":"            except pvm_exc.ConnectionError:"},{"line_number":76,"context_line":"                LOG.warning(\u0027Lost connection to NovaLink\u0027)"},{"line_number":77,"context_line":"                self.adapter \u003d None  # so we will recreate below"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_c2e80c7d","line":75,"range":{"start_line":75,"start_character":27,"end_line":75,"end_character":42},"in_reply_to":"7f231b9d_8c3829ee","updated":"2017-06-16 18:43:52.000000000","message":"Done","commit_id":"503041369c7770ce90a2ba0376fa46eae45ca77c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"203cf6a2f50593fd890c8e0960949ac08f658e12","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        try:"},{"line_number":80,"context_line":"            # Build an adapter if we don\u0027t have one."},{"line_number":81,"context_line":"            if not self.adapter:"},{"line_number":82,"context_line":"                self.adapter \u003d pvm_apt.Adapter("},{"line_number":83,"context_line":"                    helpers\u003d[log_hlp.log_helper,"},{"line_number":84,"context_line":"                             vio_hlp.vios_busy_retry_helper])"},{"line_number":85,"context_line":"                _built_adapter \u003d True"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_47b30a99","line":82,"range":{"start_line":82,"start_character":31,"end_line":82,"end_character":46},"updated":"2017-06-15 22:08:57.000000000","message":"So I did some more digging \u0026 playing, and it turns out we *never* need to rebuild the Adapter once it\u0027s been successfuly built.  (The Session inside the Adapter is the thing that needs to be refreshed, and that happens automatically and transparently when you use an Adapter that\u0027s stale/disconnected.)\n\nI think that will allow us to simplify the logic some more.","commit_id":"503041369c7770ce90a2ba0376fa46eae45ca77c"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"58ee081816993d684800428ff464ee0876bd2fbc","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        try:"},{"line_number":80,"context_line":"            # Build an adapter if we don\u0027t have one."},{"line_number":81,"context_line":"            if not self.adapter:"},{"line_number":82,"context_line":"                self.adapter \u003d pvm_apt.Adapter("},{"line_number":83,"context_line":"                    helpers\u003d[log_hlp.log_helper,"},{"line_number":84,"context_line":"                             vio_hlp.vios_busy_retry_helper])"},{"line_number":85,"context_line":"                _built_adapter \u003d True"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_02f3a475","line":82,"range":{"start_line":82,"start_character":31,"end_line":82,"end_character":46},"in_reply_to":"7f231b9d_47b30a99","updated":"2017-06-16 18:43:52.000000000","message":"I don\u0027t see any way that helps simplify anything.","commit_id":"503041369c7770ce90a2ba0376fa46eae45ca77c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"203cf6a2f50593fd890c8e0960949ac08f658e12","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                # TODO(efried): Other disk adapters, by conf selection."},{"line_number":100,"context_line":"                self.disk_dvr \u003d ssp.SSPDiskAdapter(self.adapter,"},{"line_number":101,"context_line":"                                                   self.host_wrapper.uuid)"},{"line_number":102,"context_line":"        except pvm_exc.ConnectionError:"},{"line_number":103,"context_line":"            self.adapter \u003d None  # so we can try again next time"},{"line_number":104,"context_line":"            if _built_adapter:"},{"line_number":105,"context_line":"                LOG.warning(\u0027Lost connection to NovaLink after reconnect\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_ac3765ff","line":102,"range":{"start_line":102,"start_character":0,"end_line":102,"end_character":39},"updated":"2017-06-15 22:08:57.000000000","message":"Ditto HttpNotFound","commit_id":"503041369c7770ce90a2ba0376fa46eae45ca77c"},{"author":{"_account_id":10608,"name":"Matthew Edmonds","email":"edmondsw@us.ibm.com","username":"edmondsw"},"change_message_id":"58ee081816993d684800428ff464ee0876bd2fbc","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                # TODO(efried): Other disk adapters, by conf selection."},{"line_number":100,"context_line":"                self.disk_dvr \u003d ssp.SSPDiskAdapter(self.adapter,"},{"line_number":101,"context_line":"                                                   self.host_wrapper.uuid)"},{"line_number":102,"context_line":"        except pvm_exc.ConnectionError:"},{"line_number":103,"context_line":"            self.adapter \u003d None  # so we can try again next time"},{"line_number":104,"context_line":"            if _built_adapter:"},{"line_number":105,"context_line":"                LOG.warning(\u0027Lost connection to NovaLink after reconnect\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f231b9d_a2ebd075","line":102,"range":{"start_line":102,"start_character":0,"end_line":102,"end_character":39},"in_reply_to":"7f231b9d_ac3765ff","updated":"2017-06-16 18:43:52.000000000","message":"Done","commit_id":"503041369c7770ce90a2ba0376fa46eae45ca77c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3627305f4bcfb3db61d33e86dea7bb497a0a0481","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        self.image_api \u003d image.API()"},{"line_number":62,"context_line":"        self._check_and_init_host()"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def _check_and_init_host(self):"},{"line_number":65,"context_line":"        _initialized_at_entry \u003d (self.adapter is not None)"},{"line_number":66,"context_line":"        _built_adapter \u003d False"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5f201791_94045dc8","line":64,"updated":"2017-06-20 17:42:18.000000000","message":"Let\u0027s start off here by setting self.host_wrapper \u003d None.  Then we can do away with the return value (whose calculation is pretty complicated and tough to follow) and get_available_resource() can instead use `if self.host_wrapper is None`.","commit_id":"dd3540d685f44f34aa3a6605b2cb250237aebd55"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3627305f4bcfb3db61d33e86dea7bb497a0a0481","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            except pvm_exc.ConnectionError, pvm_exc.HttpNotFound:"},{"line_number":74,"context_line":"                LOG.warning(\u0027Lost connection to NovaLink\u0027)"},{"line_number":75,"context_line":"                self.adapter \u003d None  # so we will recreate below"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        disabled_reason \u003d None"},{"line_number":78,"context_line":"        try:"},{"line_number":79,"context_line":"            # Build an adapter if we don\u0027t have one."}],"source_content_type":"text/x-python","patch_set":9,"id":"5f201791_7432e1a9","line":76,"updated":"2017-06-20 17:42:18.000000000","message":"How about `else: return` here?  That should let us get rid of `if not self.adapter` below.","commit_id":"dd3540d685f44f34aa3a6605b2cb250237aebd55"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3627305f4bcfb3db61d33e86dea7bb497a0a0481","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                self.adapter \u003d pvm_apt.Adapter("},{"line_number":82,"context_line":"                    helpers\u003d[log_hlp.log_helper,"},{"line_number":83,"context_line":"                             vio_hlp.vios_busy_retry_helper])"},{"line_number":84,"context_line":"                _built_adapter \u003d True"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"            if _built_adapter:"},{"line_number":87,"context_line":"                # Make sure at least one Virtual I/O Server is available."},{"line_number":88,"context_line":"                pvm_par.validate_vios_ready(self.adapter, max_wait_time\u003d0)"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5f201791_b4c5195e","line":86,"range":{"start_line":84,"start_character":0,"end_line":86,"end_character":30},"updated":"2017-06-20 17:42:18.000000000","message":"If the only thing we\u0027re using _built_adapter for is selecting a log message, I would love to get rid of it.  I think \u0027No connection to NovaLink\u0027 will be sufficient given the rest of the context in the log.","commit_id":"dd3540d685f44f34aa3a6605b2cb250237aebd55"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3627305f4bcfb3db61d33e86dea7bb497a0a0481","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                # TODO(efried): Other disk adapters, by conf selection."},{"line_number":99,"context_line":"                self.disk_dvr \u003d ssp.SSPDiskAdapter(self.adapter,"},{"line_number":100,"context_line":"                                                   self.host_wrapper.uuid)"},{"line_number":101,"context_line":"        except pvm_exc.ConnectionError, pvc_exc.HttpNotFound:"},{"line_number":102,"context_line":"            self.adapter \u003d None  # so we can try again next time"},{"line_number":103,"context_line":"            if _built_adapter:"},{"line_number":104,"context_line":"                LOG.warning(\u0027Lost connection to NovaLink after reconnect\u0027)"},{"line_number":105,"context_line":"            else:"},{"line_number":106,"context_line":"                LOG.warning(\u0027Unable to connect to NovaLink\u0027)"},{"line_number":107,"context_line":"            disabled_reason \u003d \u0027Auto-disabled: Unable to connect to NovaLink\u0027"},{"line_number":108,"context_line":"        except pvm_exc.ViosNotAvailable:"},{"line_number":109,"context_line":"            self.adapter \u003d None  # so we can try again next time"},{"line_number":110,"context_line":"            LOG.warning(\u0027No available Virtual I/O Server\u0027)"},{"line_number":111,"context_line":"            disabled_reason \u003d \u0027Auto-disabled: No available Virtual I/O Server\u0027"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        if _initialized_at_entry and not self.adapter:"},{"line_number":114,"context_line":"            self._autoset_host_enabled(False, disabled_reason\u003ddisabled_reason)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f201791_f49ef152","line":111,"range":{"start_line":101,"start_character":0,"end_line":111,"end_character":78},"updated":"2017-06-20 17:42:18.000000000","message":"I appreciate that you\u0027re trying to be really precise with the log messages and disabled_reason, but for the sake of simplifying the code, I would rather collapse all of this to a single except: clause with no conditions in it.  If we use LOG.exception, it\u0027ll delineate which of the calls above (L81/88/95/99) failed, and that between that and the context in the log (having seen \"The PowerVM compute driver has been initialized\" ever), it\u0027ll be clear what\u0027s going on.","commit_id":"dd3540d685f44f34aa3a6605b2cb250237aebd55"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3627305f4bcfb3db61d33e86dea7bb497a0a0481","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            LOG.warning(\u0027No available Virtual I/O Server\u0027)"},{"line_number":111,"context_line":"            disabled_reason \u003d \u0027Auto-disabled: No available Virtual I/O Server\u0027"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        if _initialized_at_entry and not self.adapter:"},{"line_number":114,"context_line":"            self._autoset_host_enabled(False, disabled_reason\u003ddisabled_reason)"},{"line_number":115,"context_line":"            return False"},{"line_number":116,"context_line":"        elif self.adapter and not _initialized_at_entry:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f201791_f4f5d184","line":113,"range":{"start_line":113,"start_character":11,"end_line":113,"end_character":32},"updated":"2017-06-20 17:42:18.000000000","message":"I wonder if we can just use self._is_auto_disabled instead and get rid of this variable.","commit_id":"dd3540d685f44f34aa3a6605b2cb250237aebd55"}]}
