)]}'
{"nova/objects/instance.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"d1bb87f80ff0e6c5291ea496b116452e3321cc73","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        # BuildRequest object before the instance exists in a cell. Because"},{"line_number":255,"context_line":"        # name may rely on the db id we can\u0027t know what it is until it\u0027s in a"},{"line_number":256,"context_line":"        # cell. This will not survive being transferred over RPC."},{"line_number":257,"context_line":"        _name \u003d getattr(self, \u0027_name\u0027, None)"},{"line_number":258,"context_line":"        if _name:"},{"line_number":259,"context_line":"            return _name"},{"line_number":260,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_cf00d904","line":257,"updated":"2016-06-08 21:28:20.000000000","message":"An alternative here would be to check if self.id is set and return a blank name if not. I thought that had a small risk for happening inadvertently vs this explicit case, but I can go either way.","commit_id":"39771f768ff23b9a89070dd9eee95476b77bcb71"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"82c3705e1f4da7d9adfdaaa419871289d8932ba8","unresolved":false,"context_lines":[{"line_number":259,"context_line":"            return _name"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"        try:"},{"line_number":262,"context_line":"            base_name \u003d CONF.instance_name_template % self.id"},{"line_number":263,"context_line":"        except TypeError:"},{"line_number":264,"context_line":"            # Support templates like \"uuid-%(uuid)s\", etc."},{"line_number":265,"context_line":"            info \u003d {}"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_21b6d1f8","line":262,"updated":"2016-06-08 21:35:05.000000000","message":"Or I could catch the exception from the failed lazy load here.","commit_id":"39771f768ff23b9a89070dd9eee95476b77bcb71"},{"author":{"_account_id":17532,"name":"Tina Kevin","email":"song.ruixia@zte.com.cn","username":"SongRuixia"},"change_message_id":"2631db3e29b1458641e837df86fe39bac4cf9c61","unresolved":false,"context_lines":[{"line_number":269,"context_line":"                base_name \u003d CONF.instance_name_template % info"},{"line_number":270,"context_line":"            except KeyError:"},{"line_number":271,"context_line":"                base_name \u003d self.uuid"},{"line_number":272,"context_line":"        except exception.ObjectActionError:"},{"line_number":273,"context_line":"            # This indicates self.id was not set and could not be lazy loaded."},{"line_number":274,"context_line":"            # What this means is the instance has not been persisted to a db"},{"line_number":275,"context_line":"            # yet, which should indicate it has not been scheduled yet. In this"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_07702171","line":272,"range":{"start_line":272,"start_character":25,"end_line":272,"end_character":42},"updated":"2016-06-14 11:31:14.000000000","message":"what time this exception.ObjectActionError will be thrown?","commit_id":"a2609397cb93abb5f55800cbdb46e76f6d1f0962"},{"author":{"_account_id":17532,"name":"Tina Kevin","email":"song.ruixia@zte.com.cn","username":"SongRuixia"},"change_message_id":"18a1aab4c4db927ed9ee89115a4871d8971b8806","unresolved":false,"context_lines":[{"line_number":269,"context_line":"                base_name \u003d CONF.instance_name_template % info"},{"line_number":270,"context_line":"            except KeyError:"},{"line_number":271,"context_line":"                base_name \u003d self.uuid"},{"line_number":272,"context_line":"        except exception.ObjectActionError:"},{"line_number":273,"context_line":"            # This indicates self.id was not set and could not be lazy loaded."},{"line_number":274,"context_line":"            # What this means is the instance has not been persisted to a db"},{"line_number":275,"context_line":"            # yet, which should indicate it has not been scheduled yet. In this"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_42eb37dc","line":272,"range":{"start_line":272,"start_character":25,"end_line":272,"end_character":42},"in_reply_to":"7aa08908_07702171","updated":"2016-06-14 11:53:02.000000000","message":"I think \"base_name \u003d CONF.instance_name_template % self.id\" can not throw an  exception.ObjectActionError.\nSo why catch this exception in here?","commit_id":"a2609397cb93abb5f55800cbdb46e76f6d1f0962"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"6efdd8811fa55592470e8d38432e7146627efb78","unresolved":false,"context_lines":[{"line_number":269,"context_line":"                base_name \u003d CONF.instance_name_template % info"},{"line_number":270,"context_line":"            except KeyError:"},{"line_number":271,"context_line":"                base_name \u003d self.uuid"},{"line_number":272,"context_line":"        except exception.ObjectActionError:"},{"line_number":273,"context_line":"            # This indicates self.id was not set and could not be lazy loaded."},{"line_number":274,"context_line":"            # What this means is the instance has not been persisted to a db"},{"line_number":275,"context_line":"            # yet, which should indicate it has not been scheduled yet. In this"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_9a229950","line":272,"range":{"start_line":272,"start_character":25,"end_line":272,"end_character":42},"in_reply_to":"7aa08908_42eb37dc","updated":"2016-06-14 15:46:25.000000000","message":"It raises ObjectActionError if \u0027id\u0027 is not set on self. In that case the object will try to lazy-load that field which will fail with ObjectActionError.","commit_id":"a2609397cb93abb5f55800cbdb46e76f6d1f0962"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7499eedc6d5c832037b6a9f6d30c604144c6dfcb","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        except exception.ObjectActionError:"},{"line_number":273,"context_line":"            # This indicates self.id was not set and could not be lazy loaded."},{"line_number":274,"context_line":"            # What this means is the instance has not been persisted to a db"},{"line_number":275,"context_line":"            # yet, which should indicate it has not been scheduled yet. In this"},{"line_number":276,"context_line":"            # situation it will have a blank name."},{"line_number":277,"context_line":"            base_name \u003d \u0027\u0027"},{"line_number":278,"context_line":"        return base_name"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_fed86d81","line":275,"range":{"start_line":275,"start_character":19,"end_line":275,"end_character":70},"updated":"2016-06-10 20:01:32.000000000","message":"So, nova.compute.api.API._populate_instance_for_create will set the vm_state to BUILDING and the task_state to \u0027SCHEDULING\u0027, but the instance is still not created in the database yet. That\u0027s about as early as you get when creating the instance object.\n\nMaybe it\u0027d be safer to only return \u0027\u0027 when we\u0027re in that vm/task state since anything else could be an actual bug?","commit_id":"a2609397cb93abb5f55800cbdb46e76f6d1f0962"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"9620c79219d5b66a86cbf3373315c78a628c865d","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        except exception.ObjectActionError:"},{"line_number":273,"context_line":"            # This indicates self.id was not set and could not be lazy loaded."},{"line_number":274,"context_line":"            # What this means is the instance has not been persisted to a db"},{"line_number":275,"context_line":"            # yet, which should indicate it has not been scheduled yet. In this"},{"line_number":276,"context_line":"            # situation it will have a blank name."},{"line_number":277,"context_line":"            base_name \u003d \u0027\u0027"},{"line_number":278,"context_line":"        return base_name"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_1ecbb954","line":275,"range":{"start_line":275,"start_character":19,"end_line":275,"end_character":70},"in_reply_to":"7aa08908_fed86d81","updated":"2016-06-10 20:07:24.000000000","message":"Yep, that would be a good check. I can return uuid in that case since that\u0027s what an error above would return.","commit_id":"a2609397cb93abb5f55800cbdb46e76f6d1f0962"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"3372a27ccbbdc16b0ce10395f36c4d4001b9b8a1","unresolved":false,"context_lines":[{"line_number":285,"context_line":"                    self.task_state \u003d\u003d task_states.SCHEDULING):"},{"line_number":286,"context_line":"                base_name \u003d \u0027\u0027"},{"line_number":287,"context_line":"            else:"},{"line_number":288,"context_line":"                # If the vm/task states don\u0027t indicate that it\u0027s being booted"},{"line_number":289,"context_line":"                # then we have a bug here. Log an error and attempt to return"},{"line_number":290,"context_line":"                # the uuid which is what an error above would return."},{"line_number":291,"context_line":"                LOG.error(_LE(\u0027Could not lazy-load instance.id while \u0027"},{"line_number":292,"context_line":"                              \u0027attempting to generate the instance name.\u0027))"},{"line_number":293,"context_line":"                base_name \u003d self.uuid"}],"source_content_type":"text/x-python","patch_set":13,"id":"bacf61ea_886ca59d","line":290,"range":{"start_line":288,"start_character":16,"end_line":290,"end_character":69},"updated":"2016-08-03 17:09:24.000000000","message":"why not to re-raise exception here? as it\u0027s bug.","commit_id":"f0c643de2baf7eb942f8c76c816ac2393aeeacdb"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"8f80071388c23530d9d2479dfcc76a58ed920a67","unresolved":false,"context_lines":[{"line_number":285,"context_line":"                    self.task_state \u003d\u003d task_states.SCHEDULING):"},{"line_number":286,"context_line":"                base_name \u003d \u0027\u0027"},{"line_number":287,"context_line":"            else:"},{"line_number":288,"context_line":"                # If the vm/task states don\u0027t indicate that it\u0027s being booted"},{"line_number":289,"context_line":"                # then we have a bug here. Log an error and attempt to return"},{"line_number":290,"context_line":"                # the uuid which is what an error above would return."},{"line_number":291,"context_line":"                LOG.error(_LE(\u0027Could not lazy-load instance.id while \u0027"},{"line_number":292,"context_line":"                              \u0027attempting to generate the instance name.\u0027))"},{"line_number":293,"context_line":"                base_name \u003d self.uuid"}],"source_content_type":"text/x-python","patch_set":13,"id":"bacf61ea_2b4f73bf","line":290,"range":{"start_line":288,"start_character":16,"end_line":290,"end_character":69},"in_reply_to":"bacf61ea_886ca59d","updated":"2016-08-03 17:39:27.000000000","message":"It\u0027s a bug, but not something bad enough to cause an error and stop whatever process was in operation at the time. I honestly don\u0027t expect this to ever be hit, but wanted to cover all cases.","commit_id":"f0c643de2baf7eb942f8c76c816ac2393aeeacdb"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cf3f8af187921d978f8cb6373ab5f1954435a110","unresolved":false,"context_lines":[{"line_number":282,"context_line":"            # yet, which should indicate it has not been scheduled yet. In this"},{"line_number":283,"context_line":"            # situation it will have a blank name."},{"line_number":284,"context_line":"            if (self.vm_state \u003d\u003d vm_states.BUILDING and"},{"line_number":285,"context_line":"                    self.task_state \u003d\u003d task_states.SCHEDULING):"},{"line_number":286,"context_line":"                base_name \u003d \u0027\u0027"},{"line_number":287,"context_line":"            else:"},{"line_number":288,"context_line":"                # If the vm/task states don\u0027t indicate that it\u0027s being booted"}],"source_content_type":"text/x-python","patch_set":18,"id":"bacf61ea_78a09f42","line":285,"updated":"2016-08-05 19:59:49.000000000","message":"This will fail if we have some really primordial instance that doesn\u0027t have these fields set. I wonder if we should test for their presence before using them? Why not just always return the uuid regardless of what the states say?","commit_id":"d70b71855d56ca7febd80b2e44e2fa5af289d7b7"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"c54f61deffde86f9d66c0fd1c40d6aae51a2ec46","unresolved":false,"context_lines":[{"line_number":282,"context_line":"            # yet, which should indicate it has not been scheduled yet. In this"},{"line_number":283,"context_line":"            # situation it will have a blank name."},{"line_number":284,"context_line":"            if (self.vm_state \u003d\u003d vm_states.BUILDING and"},{"line_number":285,"context_line":"                    self.task_state \u003d\u003d task_states.SCHEDULING):"},{"line_number":286,"context_line":"                base_name \u003d \u0027\u0027"},{"line_number":287,"context_line":"            else:"},{"line_number":288,"context_line":"                # If the vm/task states don\u0027t indicate that it\u0027s being booted"}],"source_content_type":"text/x-python","patch_set":18,"id":"bacf61ea_3b2bc183","line":285,"in_reply_to":"bacf61ea_78a09f42","updated":"2016-08-05 20:04:22.000000000","message":"I could do that. I went with \u0027\u0027 for this case so in the API it will go from not set to set rather than uuid to whatever. I think this is a bit better, but I\u0027m happy to reconsider.","commit_id":"d70b71855d56ca7febd80b2e44e2fa5af289d7b7"}],"nova/tests/unit/objects/test_instance.py":[{"author":{"_account_id":6802,"name":"Joel Coffman","email":"jmc7tp@gmail.com","username":"joel-coffman"},"change_message_id":"63ed138e8f96e17ff4256e6187d75347a56cbf58","unresolved":false,"context_lines":[{"line_number":1203,"context_line":""},{"line_number":1204,"context_line":"    def test_name_uuid_if_no_id_post_scheduling(self):"},{"line_number":1205,"context_line":"        # inst.id is not set and can\u0027t be lazy loaded"},{"line_number":1206,"context_line":""},{"line_number":1207,"context_line":"        inst \u003d objects.Instance(context\u003dself.context,"},{"line_number":1208,"context_line":"                                uuid\u003duuids.instance,"},{"line_number":1209,"context_line":"                                vm_state\u003dvm_states.ACTIVE,"}],"source_content_type":"text/x-python","patch_set":12,"id":"dada55a8_c37aa1f0","line":1206,"updated":"2016-07-20 20:03:05.000000000","message":"Extra blank line?","commit_id":"9ef824614bfe64d45d286cd8dc31551130fcc300"}]}
