)]}'
{"glance_store/_drivers/cinder.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8c8746e6352120c947401e644728b875daa8a8d9","unresolved":false,"context_lines":[{"line_number":622,"context_line":"            return 0"},{"line_number":623,"context_line":""},{"line_number":624,"context_line":"    @capabilities.check"},{"line_number":625,"context_line":"    def add(self, image_id, image_file, image_size, hashing_algo, context\u003dNone,"},{"line_number":626,"context_line":"            verifier\u003dNone):"},{"line_number":627,"context_line":"        \"\"\""},{"line_number":628,"context_line":"        Stores an image file with supplied identifier to the backend"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_b5af6a7a","line":625,"range":{"start_line":625,"start_character":52,"end_line":625,"end_character":64},"updated":"2018-07-09 11:16:10.000000000","message":"also need to add this in base driver?\nhttps://github.com/openstack/glance_store/blob/master/glance_store/driver.py","commit_id":"9db57b524bb35f02e96f3da90e6d5c35fc2b93fe"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8c8746e6352120c947401e644728b875daa8a8d9","unresolved":false,"context_lines":[{"line_number":632,"context_line":"        :param image_id: The opaque image identifier"},{"line_number":633,"context_line":"        :param image_file: The image data to write, as a file-like object"},{"line_number":634,"context_line":"        :param image_size: The size of the image data to write, in bytes"},{"line_number":635,"context_line":"        :param context: The request context"},{"line_number":636,"context_line":"        :param verifier: An object used to verify signatures for images"},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"        :returns: tuple of URL in backing store, bytes written, checksum"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_3587da5d","line":635,"range":{"start_line":635,"start_character":9,"end_line":635,"end_character":34},"updated":"2018-07-09 11:16:10.000000000","message":"nit: need to add hashing_algo before this.","commit_id":"9db57b524bb35f02e96f3da90e6d5c35fc2b93fe"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8c8746e6352120c947401e644728b875daa8a8d9","unresolved":false,"context_lines":[{"line_number":635,"context_line":"        :param context: The request context"},{"line_number":636,"context_line":"        :param verifier: An object used to verify signatures for images"},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"        :returns: tuple of URL in backing store, bytes written, checksum"},{"line_number":639,"context_line":"                and a dictionary with storage system specific information"},{"line_number":640,"context_line":"        :raises: `glance_store.exceptions.Duplicate` if the image already"},{"line_number":641,"context_line":"                existed"},{"line_number":642,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_75bf92fb","line":639,"range":{"start_line":638,"start_character":18,"end_line":639,"end_character":73},"updated":"2018-07-09 11:16:10.000000000","message":"nit: need to modify this as well","commit_id":"9db57b524bb35f02e96f3da90e6d5c35fc2b93fe"}],"glance_store/_drivers/filesystem.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ece1c0a76447ee1f68b1648de55b8fa9d0f4a019","unresolved":false,"context_lines":[{"line_number":672,"context_line":"        :param image_file: The image data to write, as a file-like object"},{"line_number":673,"context_line":"        :param image_size: The size of the image data to write, in bytes"},{"line_number":674,"context_line":"        :param hashing_algo: A hashlib algorithm identifier (string)"},{"line_number":675,"context_line":"        :param context: The request context"},{"line_number":676,"context_line":"        :param verifier: An object used to verify signatures for images"},{"line_number":677,"context_line":""},{"line_number":678,"context_line":"        :returns: tuple of URL in backing store, bytes written, checksum,"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_03cc1688","line":675,"range":{"start_line":675,"start_character":8,"end_line":675,"end_character":43},"updated":"2018-07-18 08:25:46.000000000","message":"Nit:\nIf you are adding existing missing parameter to docstring then please add to remaining drivers as well. For example context is missing in rbd drivers docstring as well.","commit_id":"80178c2fdd999374642032c6d044fcf28aaf9b7f"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"679ff197c027675c9281aa158af70edf0dd5cf28","unresolved":false,"context_lines":[{"line_number":672,"context_line":"        :param image_file: The image data to write, as a file-like object"},{"line_number":673,"context_line":"        :param image_size: The size of the image data to write, in bytes"},{"line_number":674,"context_line":"        :param hashing_algo: A hashlib algorithm identifier (string)"},{"line_number":675,"context_line":"        :param context: The request context"},{"line_number":676,"context_line":"        :param verifier: An object used to verify signatures for images"},{"line_number":677,"context_line":""},{"line_number":678,"context_line":"        :returns: tuple of URL in backing store, bytes written, checksum,"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_b7cf9752","line":675,"range":{"start_line":675,"start_character":8,"end_line":675,"end_character":43},"in_reply_to":"5f7c97a3_03cc1688","updated":"2018-07-18 12:49:36.000000000","message":"Really good point. I\u0027ll make the documentation consistent for all the drivers.","commit_id":"80178c2fdd999374642032c6d044fcf28aaf9b7f"}],"glance_store/driver.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1a534eea83d3a8fdc553c058a516bc2a90d45d47","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from functools import wraps"},{"line_number":21,"context_line":"import hashlib"},{"line_number":22,"context_line":"import logging"},{"line_number":23,"context_line":"import six"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from oslo_config import cfg"},{"line_number":26,"context_line":"from oslo_utils import encodeutils"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_1c2f42f5","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":10},"updated":"2018-07-10 18:07:49.000000000","message":"six is a third party library should be imported after line #28","commit_id":"3efcb72b80ff0e22bf41996c30af759aebf8a447"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"1cc4be24dcef9cbb6d4668c641a0f0e566ff047c","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from functools import wraps"},{"line_number":21,"context_line":"import hashlib"},{"line_number":22,"context_line":"import logging"},{"line_number":23,"context_line":"import six"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from oslo_config import cfg"},{"line_number":26,"context_line":"from oslo_utils import encodeutils"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_7200df00","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":10},"in_reply_to":"5f7c97a3_1c2f42f5","updated":"2018-07-10 19:05:26.000000000","message":"will get this on next PS","commit_id":"3efcb72b80ff0e22bf41996c30af759aebf8a447"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6e6cab35a5f931c57d9ad0f845e840723b60ae89","unresolved":false,"context_lines":[{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        # strategy: assume this until we determine otherwise"},{"line_number":245,"context_line":"        back_compat_required \u003d True"},{"line_number":246,"context_line":"        hashing_algo \u003d \u0027md5\u0027"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"        if len(kwargs) \u003d\u003d 3:"},{"line_number":249,"context_line":"            # everything is labeled correctly, we are golden"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_cd0ecd3c","line":246,"range":{"start_line":246,"start_character":8,"end_line":246,"end_character":28},"updated":"2018-07-12 05:19:17.000000000","message":"Any particular reason to \u0027hard code\u0027 it to \u0027md5\u0027 and not \u0027sha512\u0027? AFAIK it should come from the glance config option and if not valid option is set you are setting it to sha512 somewhere below.","commit_id":"75e8366004c0185807ca85af65432bb71c3027f9"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"422bcfff3f977f3d8794f5859673effb52c7821a","unresolved":false,"context_lines":[{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        # strategy: assume this until we determine otherwise"},{"line_number":245,"context_line":"        back_compat_required \u003d True"},{"line_number":246,"context_line":"        hashing_algo \u003d \u0027md5\u0027"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"        if len(kwargs) \u003d\u003d 3:"},{"line_number":249,"context_line":"            # everything is labeled correctly, we are golden"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_47c1314e","line":246,"range":{"start_line":246,"start_character":8,"end_line":246,"end_character":28},"in_reply_to":"5f7c97a3_676ead98","updated":"2018-07-12 12:52:09.000000000","message":"Makes sense.","commit_id":"75e8366004c0185807ca85af65432bb71c3027f9"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"8a451961a72f1898cb4bcadae9e4365deed1a957","unresolved":false,"context_lines":[{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        # strategy: assume this until we determine otherwise"},{"line_number":245,"context_line":"        back_compat_required \u003d True"},{"line_number":246,"context_line":"        hashing_algo \u003d \u0027md5\u0027"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"        if len(kwargs) \u003d\u003d 3:"},{"line_number":249,"context_line":"            # everything is labeled correctly, we are golden"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_676ead98","line":246,"range":{"start_line":246,"start_character":8,"end_line":246,"end_character":28},"in_reply_to":"5f7c97a3_cd0ecd3c","updated":"2018-07-12 12:47:20.000000000","message":"Here\u0027s what\u0027s going on.  The new code is going to do both a \"checksum\" and a \"multihash\" every time.  This wrapper will throw away the \"multihash\" result.  So \u0027md5\u0027 is picked here as being very fast (since we\u0027re going to throw it away anyway).  So up top here we assume that we are processing an \"old style\" call, and we\u0027ll change both back_compat_required and hashing_algo if we figure out otherwise below.\n\nI don\u0027t think there\u0027s a faster algo than md5 for this (that\u0027s available in hashlib).","commit_id":"75e8366004c0185807ca85af65432bb71c3027f9"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"9a6886e49aad0b620de1b53addb32182be41e1f6","unresolved":false,"context_lines":[{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        # strategy: assume this until we determine otherwise"},{"line_number":245,"context_line":"        back_compat_required \u003d True"},{"line_number":246,"context_line":"        hashing_algo \u003d \u0027md5\u0027"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"        if len(kwargs) \u003d\u003d 3:"},{"line_number":249,"context_line":"            # everything is labeled correctly, we are golden"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_0c4cbe9b","line":246,"range":{"start_line":246,"start_character":8,"end_line":246,"end_character":28},"in_reply_to":"5f7c97a3_cd0ecd3c","updated":"2018-07-12 12:53:10.000000000","message":"Speed, if this value is used it really doesn\u0027t matter what algorithm is used as the result is thrown away on line 324 anyways. If hashlib had noop algorithm it would be the optimal here but md5 is pretty close to that ;)","commit_id":"75e8366004c0185807ca85af65432bb71c3027f9"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"9a6886e49aad0b620de1b53addb32182be41e1f6","unresolved":false,"context_lines":[{"line_number":228,"context_line":"        # F   store.add(1, 2, 3, hashing_algo, context_obj, verifier_obj)"},{"line_number":229,"context_line":"        # So we may need to shuffle things around."},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"        FUNCNAME \u003d \"%s.Store.add()\" % store.__module__"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        # simulate the normal parameters of store.add()"},{"line_number":234,"context_line":"        ALLOWED_KWARGS \u003d set([\u0027context\u0027, \u0027verifier\u0027, \u0027hashing_algo\u0027])"},{"line_number":235,"context_line":"        for k in kwargs.keys():"},{"line_number":236,"context_line":"            if k not in ALLOWED_KWARGS:"},{"line_number":237,"context_line":"                raise TypeError((\"%s got an unexpected keyword argument \""},{"line_number":238,"context_line":"                                 \"\u0027%s\u0027\") % (FUNCNAME, k))"},{"line_number":239,"context_line":"        total_args \u003d 3 + len(args) + len(kwargs)"},{"line_number":240,"context_line":"        if total_args \u003e 6:"},{"line_number":241,"context_line":"            raise TypeError(\"%s takes at most 6 arguments (%d given)\" %"},{"line_number":242,"context_line":"                            (FUNCNAME, total_args))"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        # strategy: assume this until we determine otherwise"},{"line_number":245,"context_line":"        back_compat_required \u003d True"},{"line_number":246,"context_line":"        hashing_algo \u003d \u0027md5\u0027"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"        if len(kwargs) \u003d\u003d 3:"},{"line_number":249,"context_line":"            # everything is labeled correctly, we are golden"},{"line_number":250,"context_line":"            back_compat_required \u003d False"},{"line_number":251,"context_line":"            context \u003d kwargs[\u0027context\u0027]"},{"line_number":252,"context_line":"            verifier \u003d kwargs[\u0027verifier\u0027]"},{"line_number":253,"context_line":"            hashing_algo \u003d kwargs[\u0027hashing_algo\u0027]"},{"line_number":254,"context_line":"        elif len(kwargs) \u003d\u003d 2:"},{"line_number":255,"context_line":"            if \u0027hashing_algo\u0027 in kwargs.keys():"},{"line_number":256,"context_line":"                # \u0027verifier\u0027 must be missing"},{"line_number":257,"context_line":"                back_compat_required \u003d False"},{"line_number":258,"context_line":"                hashing_algo \u003d kwargs[\u0027hashing_algo\u0027]"},{"line_number":259,"context_line":"                context \u003d kwargs[\u0027context\u0027]"},{"line_number":260,"context_line":"                verifier \u003d None"},{"line_number":261,"context_line":"            else:"},{"line_number":262,"context_line":"                context \u003d kwargs[\u0027context\u0027]"},{"line_number":263,"context_line":"                verifier \u003d kwargs[\u0027verifier\u0027]"},{"line_number":264,"context_line":"                if args:"},{"line_number":265,"context_line":"                    back_compat_required \u003d False"},{"line_number":266,"context_line":"                    hashing_algo \u003d args[0]"},{"line_number":267,"context_line":"        elif len(kwargs) \u003d\u003d 1:"},{"line_number":268,"context_line":"            if \u0027hashing_algo\u0027 in kwargs.keys():"},{"line_number":269,"context_line":"                # can\u0027t have context, verifier"},{"line_number":270,"context_line":"                back_compat_required \u003d False"},{"line_number":271,"context_line":"                context \u003d None"},{"line_number":272,"context_line":"                verifier \u003d None"},{"line_number":273,"context_line":"                hashing_algo \u003d kwargs[\u0027hashing_algo\u0027]"},{"line_number":274,"context_line":"            elif \u0027verifier\u0027 in kwargs.keys():"},{"line_number":275,"context_line":"                verifier \u003d kwargs[\u0027verifier\u0027]"},{"line_number":276,"context_line":"                context \u003d None"},{"line_number":277,"context_line":"                if args:"},{"line_number":278,"context_line":"                    if isinstance(args[0], six.string_types):"},{"line_number":279,"context_line":"                        back_compat_required \u003d False"},{"line_number":280,"context_line":"                        hashing_algo \u003d args[0]"},{"line_number":281,"context_line":"                        context \u003d args[1] if len(args) \u003e 1 else None"},{"line_number":282,"context_line":"                    else:"},{"line_number":283,"context_line":"                        context \u003d args[0]"},{"line_number":284,"context_line":"            else:"},{"line_number":285,"context_line":"                context \u003d kwargs[\u0027context\u0027]"},{"line_number":286,"context_line":"                verifier \u003d None"},{"line_number":287,"context_line":"                if args:"},{"line_number":288,"context_line":"                    hashing_algo \u003d args[0]"},{"line_number":289,"context_line":"                    back_compat_required \u003d False"},{"line_number":290,"context_line":"        else:"},{"line_number":291,"context_line":"            if not args:"},{"line_number":292,"context_line":"                context \u003d None"},{"line_number":293,"context_line":"                verifier \u003d None"},{"line_number":294,"context_line":"            elif isinstance(args[0], six.string_types):"},{"line_number":295,"context_line":"                # can\u0027t be context object or verifier object"},{"line_number":296,"context_line":"                back_compat_required \u003d False"},{"line_number":297,"context_line":"                hashing_algo \u003d args[0]"},{"line_number":298,"context_line":"                context \u003d args[1] if len(args) \u003e 1 else None"},{"line_number":299,"context_line":"                verifier \u003d args[2] if len(args) \u003e 2 else None"},{"line_number":300,"context_line":"            else:"},{"line_number":301,"context_line":"                context \u003d args[0]"},{"line_number":302,"context_line":"                verifier \u003d args[1] if len(args) \u003e 1 else None"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"        # final check: validate the hashing_algo"},{"line_number":305,"context_line":"        if hashing_algo not in hashlib.algorithms_available:"},{"line_number":306,"context_line":"            LOG.debug((\"Unknown hash algorithm identifier \u0027%s\u0027, \""},{"line_number":307,"context_line":"                       \"falling back to \u0027sha512\u0027\") % hashing_algo)"},{"line_number":308,"context_line":"            hashing_algo \u003d \u0027sha512\u0027"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"        # business time"},{"line_number":311,"context_line":"        (backend_url,"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_671c6d14","line":308,"range":{"start_line":231,"start_character":0,"end_line":308,"end_character":35},"updated":"2018-07-12 12:53:10.000000000","message":"We can throw all this away by making the hashing_algo last (last so we don\u0027t break any usage of positional arguments that might have happened to provide all the arguments) kwarg on the function definition and defaulting it to None. After that the only thing we need to check is if is is None, set it to \"md5\" and set back_compat_required to True. None of this error prone fiddlery is needed in case something changes in the future.","commit_id":"75e8366004c0185807ca85af65432bb71c3027f9"}]}
