)]}'
{"cinder/db/sqlalchemy/api.py":[{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"dbdef739d62e76143328769d307942b027605b79","unresolved":false,"context_lines":[{"line_number":3941,"context_line":""},{"line_number":3942,"context_line":"def get_model_for_versioned_object(versioned_object):"},{"line_number":3943,"context_line":"    VO_TO_MODEL \u003d {"},{"line_number":3944,"context_line":"        objects.Volume: models.Volume,"},{"line_number":3945,"context_line":"        objects.Snapshot: models.Snapshot,"},{"line_number":3946,"context_line":"        objects.Backup: models.Backup,"},{"line_number":3947,"context_line":"        objects.ConsistencyGroup: models.ConsistencyGroup,"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_db99f06f","line":3944,"updated":"2015-08-28 02:19:22.000000000","message":"This is a bit odd because oslo_versionedobjects is suppose to be a layer above the db, and here it is used in the db.  But ok.","commit_id":"1c8016dcba0a3627e452596a9f7f65193fc0c943"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"a770abdf8279b5a704e2546c09850aba9821840b","unresolved":false,"context_lines":[{"line_number":3941,"context_line":""},{"line_number":3942,"context_line":"def get_model_for_versioned_object(versioned_object):"},{"line_number":3943,"context_line":"    VO_TO_MODEL \u003d {"},{"line_number":3944,"context_line":"        objects.Volume: models.Volume,"},{"line_number":3945,"context_line":"        objects.Snapshot: models.Snapshot,"},{"line_number":3946,"context_line":"        objects.Backup: models.Backup,"},{"line_number":3947,"context_line":"        objects.ConsistencyGroup: models.ConsistencyGroup,"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_11fe6037","line":3944,"in_reply_to":"da20952f_db99f06f","updated":"2015-08-28 08:56:50.000000000","message":"I totally agree, I thought it too, but I was too tired last night at 3AM to think of a better way, so I submitted it as it was.  But it\u0027s fixed now, thanks for the reminder.  :-)","commit_id":"1c8016dcba0a3627e452596a9f7f65193fc0c943"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"dbdef739d62e76143328769d307942b027605b79","unresolved":false,"context_lines":[{"line_number":3958,"context_line":"        models.Backup: backup_get,"},{"line_number":3959,"context_line":"        models.ConsistencyGroup: consistencygroup_get,"},{"line_number":3960,"context_line":"        models.Service: service_get,"},{"line_number":3961,"context_line":"        models.Snapshot: _snapshot_get,"},{"line_number":3962,"context_line":"        models.SnapshotMetadata: snapshot_metadata_get,"},{"line_number":3963,"context_line":"        models.Volume: _volume_get,"},{"line_number":3964,"context_line":"        models.VolumeAdminMetadata: volume_admin_metadata_get,"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_5bc5e039","line":3961,"updated":"2015-08-28 02:19:22.000000000","message":"Why not use snapshot_get.  It is the public method, even though it directly calls _snapshot_get.","commit_id":"1c8016dcba0a3627e452596a9f7f65193fc0c943"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"a770abdf8279b5a704e2546c09850aba9821840b","unresolved":false,"context_lines":[{"line_number":3958,"context_line":"        models.Backup: backup_get,"},{"line_number":3959,"context_line":"        models.ConsistencyGroup: consistencygroup_get,"},{"line_number":3960,"context_line":"        models.Service: service_get,"},{"line_number":3961,"context_line":"        models.Snapshot: _snapshot_get,"},{"line_number":3962,"context_line":"        models.SnapshotMetadata: snapshot_metadata_get,"},{"line_number":3963,"context_line":"        models.Volume: _volume_get,"},{"line_number":3964,"context_line":"        models.VolumeAdminMetadata: volume_admin_metadata_get,"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_51d0581f","line":3961,"in_reply_to":"da20952f_5bc5e039","updated":"2015-08-28 08:56:50.000000000","message":"Because that way once we remove require_context decorator from that method (since it shouldn\u0027t be there) we will not be double checking the context.  That\u0027s part of the point of having internal methods, not duplicating checks or skipping them altogether when using controlled data.","commit_id":"1c8016dcba0a3627e452596a9f7f65193fc0c943"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"dbdef739d62e76143328769d307942b027605b79","unresolved":false,"context_lines":[{"line_number":3960,"context_line":"        models.Service: service_get,"},{"line_number":3961,"context_line":"        models.Snapshot: _snapshot_get,"},{"line_number":3962,"context_line":"        models.SnapshotMetadata: snapshot_metadata_get,"},{"line_number":3963,"context_line":"        models.Volume: _volume_get,"},{"line_number":3964,"context_line":"        models.VolumeAdminMetadata: volume_admin_metadata_get,"},{"line_number":3965,"context_line":"        models.VolumeAttachment: volume_attachment_get,"},{"line_number":3966,"context_line":"        models.VolumeMetadata: volume_metadata_get,"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_7bc0e42a","line":3963,"updated":"2015-08-28 02:19:22.000000000","message":"Ditto","commit_id":"1c8016dcba0a3627e452596a9f7f65193fc0c943"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"a770abdf8279b5a704e2546c09850aba9821840b","unresolved":false,"context_lines":[{"line_number":3960,"context_line":"        models.Service: service_get,"},{"line_number":3961,"context_line":"        models.Snapshot: _snapshot_get,"},{"line_number":3962,"context_line":"        models.SnapshotMetadata: snapshot_metadata_get,"},{"line_number":3963,"context_line":"        models.Volume: _volume_get,"},{"line_number":3964,"context_line":"        models.VolumeAdminMetadata: volume_admin_metadata_get,"},{"line_number":3965,"context_line":"        models.VolumeAttachment: volume_attachment_get,"},{"line_number":3966,"context_line":"        models.VolumeMetadata: volume_metadata_get,"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_5197f847","line":3963,"in_reply_to":"da20952f_7bc0e42a","updated":"2015-08-28 08:56:50.000000000","message":"Exact same reason.","commit_id":"1c8016dcba0a3627e452596a9f7f65193fc0c943"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"e4fa1a3af2c428991f7d099987e5456aad00a5f9","unresolved":false,"context_lines":[{"line_number":3946,"context_line":"        \u0027ConsistencyGroup\u0027: models.ConsistencyGroup,"},{"line_number":3947,"context_line":"    }"},{"line_number":3948,"context_line":""},{"line_number":3949,"context_line":"    return VO_TO_MODEL[versioned_object.obj_name()]"},{"line_number":3950,"context_line":""},{"line_number":3951,"context_line":""},{"line_number":3952,"context_line":"@require_context"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_151a757d","line":3949,"updated":"2015-08-31 10:28:09.000000000","message":"Why not just do models.get(versioned_object) and avoid a place we need to manually update code in future?","commit_id":"c06cc4c4c4ced0a24390a357c8cdd2742634751d"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"4c69fd3fb0c3e71d17cd118623815124f9bcd807","unresolved":false,"context_lines":[{"line_number":3946,"context_line":"        \u0027ConsistencyGroup\u0027: models.ConsistencyGroup,"},{"line_number":3947,"context_line":"    }"},{"line_number":3948,"context_line":""},{"line_number":3949,"context_line":"    return VO_TO_MODEL[versioned_object.obj_name()]"},{"line_number":3950,"context_line":""},{"line_number":3951,"context_line":""},{"line_number":3952,"context_line":"@require_context"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_cb0c5aee","line":3949,"in_reply_to":"da20952f_151a757d","updated":"2015-08-31 13:10:19.000000000","message":"I usually prefer explicit mappings than implicit, they are easier to follow and see the issues.  But I have no objections to changing this.","commit_id":"c06cc4c4c4ced0a24390a357c8cdd2742634751d"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"e4fa1a3af2c428991f7d099987e5456aad00a5f9","unresolved":false,"context_lines":[{"line_number":3965,"context_line":"        models.VolumeTypeExtraSpecs: volume_type_extra_specs_get,"},{"line_number":3966,"context_line":"    }"},{"line_number":3967,"context_line":""},{"line_number":3968,"context_line":"    return GET_METHODS[model](context, id, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_75017105","line":3968,"updated":"2015-08-31 10:28:09.000000000","message":"As above, I suggest moving to a consistent naming scheme and getting rid of the manually generated mapping table.","commit_id":"c06cc4c4c4ced0a24390a357c8cdd2742634751d"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"4c69fd3fb0c3e71d17cd118623815124f9bcd807","unresolved":false,"context_lines":[{"line_number":3965,"context_line":"        models.VolumeTypeExtraSpecs: volume_type_extra_specs_get,"},{"line_number":3966,"context_line":"    }"},{"line_number":3967,"context_line":""},{"line_number":3968,"context_line":"    return GET_METHODS[model](context, id, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_26c3cdee","line":3968,"in_reply_to":"da20952f_75017105","updated":"2015-08-31 13:10:19.000000000","message":"In this case it\u0027s not only that I prefer explicit, but I also think that changing db api method names to a more convenient naming scheme is a bit drastic.  I\u0027ll create a patch updating some of the names and rebase this on top of that to show you what I mean.","commit_id":"c06cc4c4c4ced0a24390a357c8cdd2742634751d"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"d40da495895c8f520eddd7eaa957b48511611a46","unresolved":false,"context_lines":[{"line_number":2547,"context_line":"def _volume_type_get_full(context, id):"},{"line_number":2548,"context_line":"    \"\"\"Return dict for a specific volume_type with extra_specs and projects.\"\"\""},{"line_number":2549,"context_line":"    return _volume_type_get(context, id, session\u003dNone, inactive\u003dFalse,"},{"line_number":2550,"context_line":"                            expected_fields\u003d(\u0027admin_metadata\u0027, \u0027metadata\u0027))"},{"line_number":2551,"context_line":""},{"line_number":2552,"context_line":""},{"line_number":2553,"context_line":"@require_context"}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_499924c3","line":2550,"updated":"2015-09-06 12:26:08.000000000","message":"admin_metadata and metadata are not part of volume_type.  It should be  expected_fields\u003d[\u0027extra_specs\u0027, \u0027projects\u0027] :)","commit_id":"91a73a0473370bbb83bab603cdd04d0feed0c4be"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"c0487f6e22ef6985ee043032c66517d2152e8238","unresolved":false,"context_lines":[{"line_number":2547,"context_line":"def _volume_type_get_full(context, id):"},{"line_number":2548,"context_line":"    \"\"\"Return dict for a specific volume_type with extra_specs and projects.\"\"\""},{"line_number":2549,"context_line":"    return _volume_type_get(context, id, session\u003dNone, inactive\u003dFalse,"},{"line_number":2550,"context_line":"                            expected_fields\u003d(\u0027admin_metadata\u0027, \u0027metadata\u0027))"},{"line_number":2551,"context_line":""},{"line_number":2552,"context_line":""},{"line_number":2553,"context_line":"@require_context"}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_0a7d3e6c","line":2550,"in_reply_to":"da20952f_499924c3","updated":"2015-09-07 15:45:01.000000000","message":"Thanks!!  Really good catch, I clearly copied this from the volume object instead volume_type.","commit_id":"91a73a0473370bbb83bab603cdd04d0feed0c4be"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"bf2d108e7b75b1a2b396aff2d88f1177f1fadc3b","unresolved":false,"context_lines":[{"line_number":4090,"context_line":"def get_model_for_versioned_object(versioned_object):"},{"line_number":4091,"context_line":"    # Exceptions to model mapping, in general Versioned Objects have the same"},{"line_number":4092,"context_line":"    # name as their ORM models counterparts, but there are some that diverge"},{"line_number":4093,"context_line":"    VO_TO_MODEL_EXCEPTIONS \u003d {"},{"line_number":4094,"context_line":"        \u0027BackupImport\u0027: models.Backup,"},{"line_number":4095,"context_line":"        \u0027VolumeType\u0027: models.VolumeTypes"},{"line_number":4096,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_499c085d","line":4093,"updated":"2015-09-29 05:04:58.000000000","message":"What\u0027s with the use of all the \"cap\" and camel case vars anyway?","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9447e36b19d299c970f55f8547d72e0086c4632c","unresolved":false,"context_lines":[{"line_number":4090,"context_line":"def get_model_for_versioned_object(versioned_object):"},{"line_number":4091,"context_line":"    # Exceptions to model mapping, in general Versioned Objects have the same"},{"line_number":4092,"context_line":"    # name as their ORM models counterparts, but there are some that diverge"},{"line_number":4093,"context_line":"    VO_TO_MODEL_EXCEPTIONS \u003d {"},{"line_number":4094,"context_line":"        \u0027BackupImport\u0027: models.Backup,"},{"line_number":4095,"context_line":"        \u0027VolumeType\u0027: models.VolumeTypes"},{"line_number":4096,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_450229b6","line":4093,"in_reply_to":"9a1a9d01_499c085d","updated":"2015-10-01 17:22:28.000000000","message":"I\u0027m using \"variables\" in caps for constants, as pep8 recommends.  Since there is no builtin frozendict I had to use a normal dict.","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9447e36b19d299c970f55f8547d72e0086c4632c","unresolved":false,"context_lines":[{"line_number":4120,"context_line":"    return globals().get(method_name)"},{"line_number":4121,"context_line":""},{"line_number":4122,"context_line":""},{"line_number":4123,"context_line":"GET_METHODS \u003d {}"},{"line_number":4124,"context_line":""},{"line_number":4125,"context_line":""},{"line_number":4126,"context_line":"@require_context"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_258cd534","line":4123,"updated":"2015-10-01 17:22:28.000000000","message":"In here I use caps for a global variable like we are doing with _FACADE at the top of this file, although since this is an internal variable it should start with _","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"}],"cinder/objects/backup.py":[{"author":{"_account_id":17718,"name":"Lallana","email":"gaozhiqiang2@huawei.com","username":"Lallana"},"change_message_id":"7abe18f025985fc4915503be5675d9ad87879eda","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        for name, field in backup.fields.items():"},{"line_number":95,"context_line":"            value \u003d db_backup.get(name)"},{"line_number":96,"context_line":"            if isinstance(field, fields.IntegerField):"},{"line_number":97,"context_line":"                value \u003d value if value is not None else 0"},{"line_number":98,"context_line":"            backup[name] \u003d value"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        backup._context \u003d context"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_56a76ebc","line":97,"updated":"2015-09-01 02:04:24.000000000","message":"Perhaps the variable name differs from the name of a variable\u0027s value will be better.","commit_id":"bb1881f0c70b33bced965650b825432d2f324078"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"1acca9522984c90da976bccc7329fa920acc2802","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        for name, field in backup.fields.items():"},{"line_number":95,"context_line":"            value \u003d db_backup.get(name)"},{"line_number":96,"context_line":"            if isinstance(field, fields.IntegerField):"},{"line_number":97,"context_line":"                value \u003d value if value is not None else 0"},{"line_number":98,"context_line":"            backup[name] \u003d value"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        backup._context \u003d context"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_30e42caa","line":97,"in_reply_to":"da20952f_56a76ebc","updated":"2015-09-01 11:15:46.000000000","message":"That is not something introduced in this patch or within its scope.","commit_id":"bb1881f0c70b33bced965650b825432d2f324078"}],"cinder/objects/base.py":[{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"d40da495895c8f520eddd7eaa957b48511611a46","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        orm_obj \u003d db.get_by_id(context, model, id, *args, **kwargs)"},{"line_number":86,"context_line":"        kargs \u003d {}"},{"line_number":87,"context_line":"        if hasattr(cls, \u0027DEFAULT_EXPECTED_ATTR\u0027):"},{"line_number":88,"context_line":"            kargs \u003d {\u0027expected_attrs\u0027: getattr(cls, \u0027DEFAULT_EXPECTED_ATTR\u0027)}"},{"line_number":89,"context_line":"        return cls._from_db_object(context, cls(context), orm_obj, **kargs)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_49b2844d","line":88,"updated":"2015-09-06 12:26:08.000000000","message":"Can you use the default return of getattr here instead of having an if block?  kargs \u003d {\u0027expected_attrs\u0027: getattr(class, \u0027DEFAULT_EXPECTED_ATTR\u0027, [])","commit_id":"91a73a0473370bbb83bab603cdd04d0feed0c4be"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"c0487f6e22ef6985ee043032c66517d2152e8238","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        orm_obj \u003d db.get_by_id(context, model, id, *args, **kwargs)"},{"line_number":86,"context_line":"        kargs \u003d {}"},{"line_number":87,"context_line":"        if hasattr(cls, \u0027DEFAULT_EXPECTED_ATTR\u0027):"},{"line_number":88,"context_line":"            kargs \u003d {\u0027expected_attrs\u0027: getattr(cls, \u0027DEFAULT_EXPECTED_ATTR\u0027)}"},{"line_number":89,"context_line":"        return cls._from_db_object(context, cls(context), orm_obj, **kargs)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_2a2e0243","line":88,"in_reply_to":"da20952f_49b2844d","updated":"2015-09-07 15:45:01.000000000","message":"No, I cannot do that, since not all `_from_db_object` methods from objects accept `expected_attrs`; if they did I wouldn\u0027t need a dictionary, I would just pass the named argument directly.","commit_id":"91a73a0473370bbb83bab603cdd04d0feed0c4be"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"bf2d108e7b75b1a2b396aff2d88f1177f1fadc3b","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        return changes"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    @base.remotable_classmethod"},{"line_number":76,"context_line":"    def get_by_id(cls, context, id, *args, **kwargs):"},{"line_number":77,"context_line":"        # To get by id we need to have a model and for the model to"},{"line_number":78,"context_line":"        # have and id field"},{"line_number":79,"context_line":"        if \u0027id\u0027 not in cls.fields:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_89e460e1","line":76,"updated":"2015-09-29 05:04:58.000000000","message":"I\u0027m trying to understand your patch, based on the commit message, moving teh \"get_by_id\" into the base here pretty much \"should\" do what you propose.  I don\u0027t follow the various changes you\u0027ve made to the data base at all.  Also, if this works as it should I believe the required changes to the unit test should be fairly minimal as well.","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9447e36b19d299c970f55f8547d72e0086c4632c","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        return changes"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    @base.remotable_classmethod"},{"line_number":76,"context_line":"    def get_by_id(cls, context, id, *args, **kwargs):"},{"line_number":77,"context_line":"        # To get by id we need to have a model and for the model to"},{"line_number":78,"context_line":"        # have and id field"},{"line_number":79,"context_line":"        if \u0027id\u0027 not in cls.fields:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_2535b5f6","line":76,"in_reply_to":"9a1a9d01_89e460e1","updated":"2015-10-01 17:22:28.000000000","message":"Most of the test changes are on where we do the mocks, as for the DB stuff, it\u0027s basically 2 functions:\n\n- Return a ORM model from a versioned object: This is needed here but it will be needed for conditional updates as well (the patch on top of this one).\n\n- Generic get method that given a model and a resource id (with optional args) will return requested resource.","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"ac3997d2ed640e30c65d4dc2c8cb90c3588515ca","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    @base.remotable_classmethod"},{"line_number":76,"context_line":"    def get_by_id(cls, context, id, *args, **kwargs):"},{"line_number":77,"context_line":"        # To get by id we need to have a model and for the model to"},{"line_number":78,"context_line":"        # have and id field"},{"line_number":79,"context_line":"        if \u0027id\u0027 not in cls.fields:"},{"line_number":80,"context_line":"            msg \u003d (_(\u0027VersionedObject %s cannot retrieve object by id.\u0027) %"},{"line_number":81,"context_line":"                   (cls.obj_name()))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_900c85ee","line":78,"updated":"2015-09-29 01:54:18.000000000","message":"s/and/an/","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9447e36b19d299c970f55f8547d72e0086c4632c","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    @base.remotable_classmethod"},{"line_number":76,"context_line":"    def get_by_id(cls, context, id, *args, **kwargs):"},{"line_number":77,"context_line":"        # To get by id we need to have a model and for the model to"},{"line_number":78,"context_line":"        # have and id field"},{"line_number":79,"context_line":"        if \u0027id\u0027 not in cls.fields:"},{"line_number":80,"context_line":"            msg \u003d (_(\u0027VersionedObject %s cannot retrieve object by id.\u0027) %"},{"line_number":81,"context_line":"                   (cls.obj_name()))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_e53eddd9","line":78,"in_reply_to":"9a1a9d01_900c85ee","updated":"2015-10-01 17:22:28.000000000","message":"Done","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"}],"cinder/objects/snapshot.py":[{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"bf2d108e7b75b1a2b396aff2d88f1177f1fadc3b","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    # Version 1.0: Initial version"},{"line_number":37,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    DEFAULT_EXPECTED_ATTR \u003d (\u0027metadata\u0027,)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    fields \u003d {"},{"line_number":42,"context_line":"        \u0027id\u0027: fields.UUIDField(),"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_49b96878","line":39,"updated":"2015-09-29 05:04:58.000000000","message":"I really don\u0027t follow this, why are we setting this variable with \"metadata\" and feeding it into the base class just so it can use it to turn around and feed it back into the classes (files) _from_db_object?\n\nSo it goes like DEFAULT_EXPECTED_ATTR ---\u003e base.get_by_id ---\u003e this._from_db_object(x, x,, x, expected_attrs\u003dDEFAULT_EXPECTED_ATTRS) ????\n\nAlso how are you choosing the defaults here?  It seems to me that volume (which is a valid attr) is a much more common/useful default that metadata?\n\nI apologize really... I\u0027m not trying to be difficult here.","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9447e36b19d299c970f55f8547d72e0086c4632c","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    # Version 1.0: Initial version"},{"line_number":37,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    DEFAULT_EXPECTED_ATTR \u003d (\u0027metadata\u0027,)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    fields \u003d {"},{"line_number":42,"context_line":"        \u0027id\u0027: fields.UUIDField(),"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_095beb2f","line":39,"in_reply_to":"9a1a9d01_49b96878","updated":"2015-10-01 17:22:28.000000000","message":"No apologies necessary.\n\nYes, you got it right, that\u0027s basically how it goes, some versioned objects have expected_attrs and others don\u0027t.\n\nI chose the DEFAULT_EXPECTED_ATTR from the current get_by_id method (the one that\u0027s been replace), since it is passing it as expected_attrs.  This is because some attributes from the Versioned Object are lazy loaded, so those in DEFAULT_EXPECTED_ATTR are loaded with the rest of the attributes.","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"}],"cinder/objects/volume.py":[{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"bf2d108e7b75b1a2b396aff2d88f1177f1fadc3b","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    #              volume_type"},{"line_number":38,"context_line":"    VERSION \u003d \u00271.1\u0027"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    DEFAULT_EXPECTED_ATTR \u003d (\u0027admin_metadata\u0027, \u0027metadata\u0027)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    fields \u003d {"},{"line_number":43,"context_line":"        \u0027id\u0027: fields.UUIDField(),"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_a9a84421","line":40,"updated":"2015-09-29 05:04:58.000000000","message":"not sure on this one either... why the metadata, and not say volume_type or attachment?","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9447e36b19d299c970f55f8547d72e0086c4632c","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    #              volume_type"},{"line_number":38,"context_line":"    VERSION \u003d \u00271.1\u0027"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    DEFAULT_EXPECTED_ATTR \u003d (\u0027admin_metadata\u0027, \u0027metadata\u0027)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    fields \u003d {"},{"line_number":43,"context_line":"        \u0027id\u0027: fields.UUIDField(),"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_e96c77d2","line":40,"in_reply_to":"9a1a9d01_a9a84421","updated":"2015-10-01 17:22:28.000000000","message":"Because it\u0027s what is defined on line 188 from base code.","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"}],"cinder/tests/unit/objects/__init__.py":[{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"d4d5d28c29d82d8c1ed11412b25c7b318632eb4b","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        self.project_id \u003d 456"},{"line_number":31,"context_line":"        self.context \u003d context.RequestContext(self.user_id, self.project_id,"},{"line_number":32,"context_line":"                                              is_admin\u003dFalse)"},{"line_number":33,"context_line":"        db_api.GET_METHODS \u003d {}"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_49e088fa","line":33,"updated":"2015-09-29 04:43:20.000000000","message":"Kinda wondering what these calls are for too.  So they\u0027ve been added here and in one other driver unit test as well as the sql api, but there\u0027s no explanation as to why?\n\nThere\u0027s also no sign of this being used anywhere besides these two files.","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"cba85ef54120bcb81ddac4176d3ec25dc198f084","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        self.project_id \u003d 456"},{"line_number":31,"context_line":"        self.context \u003d context.RequestContext(self.user_id, self.project_id,"},{"line_number":32,"context_line":"                                              is_admin\u003dFalse)"},{"line_number":33,"context_line":"        db_api.GET_METHODS \u003d {}"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_3d9ee0b8","line":33,"in_reply_to":"9a1a9d01_09452b16","updated":"2015-10-03 23:55:53.000000000","message":"probably should document this inline here then as John is sort of suggesting.","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"613d819305c50bd1d464b8ab70d3d9c4a0945eb0","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        self.project_id \u003d 456"},{"line_number":31,"context_line":"        self.context \u003d context.RequestContext(self.user_id, self.project_id,"},{"line_number":32,"context_line":"                                              is_admin\u003dFalse)"},{"line_number":33,"context_line":"        db_api.GET_METHODS \u003d {}"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a2fa921_e2bb04c3","line":33,"in_reply_to":"9a1a9d01_3d9ee0b8","updated":"2015-10-06 15:24:19.000000000","message":"Done","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9447e36b19d299c970f55f8547d72e0086c4632c","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        self.project_id \u003d 456"},{"line_number":31,"context_line":"        self.context \u003d context.RequestContext(self.user_id, self.project_id,"},{"line_number":32,"context_line":"                                              is_admin\u003dFalse)"},{"line_number":33,"context_line":"        db_api.GET_METHODS \u003d {}"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_09452b16","line":33,"in_reply_to":"9a1a9d01_49e088fa","updated":"2015-10-01 17:22:28.000000000","message":"The context is used in the tests and the GET_METHODS needs to be set to {} because otherwise it would store the mocks between tests and it would not be calling the new mocks.","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"}],"cinder/tests/unit/volume/drivers/emc/scaleio/__init__.py":[{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"8afb10bc82a35945436560552067a96b5db73319","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        self.mock_object(requests, \u0027get\u0027, self.do_request)"},{"line_number":119,"context_line":"        self.mock_object(requests, \u0027post\u0027, self.do_request)"},{"line_number":120,"context_line":"        db_api.GET_METHODS \u003d {}"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def do_request(self, url, *args, **kwargs):"},{"line_number":123,"context_line":"        \"\"\"Do a fake GET/POST API request."}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_2658e389","line":120,"updated":"2015-09-29 04:01:40.000000000","message":"Why was this added?  It\u0027s not even used.","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9447e36b19d299c970f55f8547d72e0086c4632c","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        self.mock_object(requests, \u0027get\u0027, self.do_request)"},{"line_number":119,"context_line":"        self.mock_object(requests, \u0027post\u0027, self.do_request)"},{"line_number":120,"context_line":"        db_api.GET_METHODS \u003d {}"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def do_request(self, url, *args, **kwargs):"},{"line_number":123,"context_line":"        \"\"\"Do a fake GET/POST API request."}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_69194722","line":120,"in_reply_to":"9a1a9d01_2658e389","updated":"2015-10-01 17:22:28.000000000","message":"This is added because GET_METHODS keeps a mapping of models to get_by_id methods, and we need to clear it between tests so mocked get_by_id methods are not kept from one test to the next.","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"cba85ef54120bcb81ddac4176d3ec25dc198f084","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        self.mock_object(requests, \u0027get\u0027, self.do_request)"},{"line_number":119,"context_line":"        self.mock_object(requests, \u0027post\u0027, self.do_request)"},{"line_number":120,"context_line":"        db_api.GET_METHODS \u003d {}"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def do_request(self, url, *args, **kwargs):"},{"line_number":123,"context_line":"        \"\"\"Do a fake GET/POST API request."}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_dda48409","line":120,"in_reply_to":"9a1a9d01_69194722","updated":"2015-10-03 23:55:53.000000000","message":"yah same this as the other __init__.py file.   Please add a comment doc block above the like to explain it.   We don\u0027t want someone removing it.","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"613d819305c50bd1d464b8ab70d3d9c4a0945eb0","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        self.mock_object(requests, \u0027get\u0027, self.do_request)"},{"line_number":119,"context_line":"        self.mock_object(requests, \u0027post\u0027, self.do_request)"},{"line_number":120,"context_line":"        db_api.GET_METHODS \u003d {}"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def do_request(self, url, *args, **kwargs):"},{"line_number":123,"context_line":"        \"\"\"Do a fake GET/POST API request."}],"source_content_type":"text/x-python","patch_set":9,"id":"7a2fa921_e209c496","line":120,"in_reply_to":"9a1a9d01_dda48409","updated":"2015-10-06 15:24:19.000000000","message":"Done","commit_id":"029ba14e833cb55b1d747b01696281fb27a62a08"}]}
