)]}'
{"tripleo_common/utils/glance.py":[{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"ae145099681e820a68d9f640a289806db1d5eb49","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"def create_or_find_kernel_and_ramdisk(glanceclient, kernel_name, ramdisk_name):"},{"line_number":23,"context_line":"    \"\"\"Find or create a given kernel and ramdisk in Glance."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    If either kernel_path or ramdisk_path is None, they will not be created,"},{"line_number":26,"context_line":"    and an exception will be raised if it does not exist in Glance."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    :param glanceclient: A client for Glance."},{"line_number":29,"context_line":"    :param kernel_name: Name to search for or create for the kernel."}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_89979e48","line":26,"range":{"start_line":23,"start_character":0,"end_line":26,"end_character":67},"updated":"2019-06-13 18:45:46.000000000","message":"nit: ideally the docstring should be updated since we now support images via file:// or http://. Not just glance.","commit_id":"8245066895e0bcbc7597f6f6670db4f7d12793bf"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"ae145099681e820a68d9f640a289806db1d5eb49","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _check_image(glanceclient, name, disk_format, image_type):"},{"line_number":42,"context_line":"    if re.match(r\u0027^(file|https?)://\u0027, name):"},{"line_number":43,"context_line":"        return name"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    try:"},{"line_number":46,"context_line":"        if isinstance(glanceclient, real_glance_client):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_e99ada5f","line":43,"range":{"start_line":43,"start_character":8,"end_line":43,"end_character":19},"updated":"2019-06-13 18:45:46.000000000","message":"Should we check that the file exists? And do a \"HEAD\" request to check the url is good without actually downloading the entire file?","commit_id":"8245066895e0bcbc7597f6f6670db4f7d12793bf"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"24351996392ebeeedd7f4ed3b52a6bcbae157b3e","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _check_image(glanceclient, name, disk_format, image_type):"},{"line_number":42,"context_line":"    if re.match(r\u0027^(file|https?)://\u0027, name):"},{"line_number":43,"context_line":"        return name"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    try:"},{"line_number":46,"context_line":"        if isinstance(glanceclient, real_glance_client):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_6707e919","line":43,"range":{"start_line":43,"start_character":8,"end_line":43,"end_character":19},"in_reply_to":"9fb8cfa7_10be66fe","updated":"2019-06-14 09:48:52.000000000","message":"Yes, this makes sense. Thanks!","commit_id":"8245066895e0bcbc7597f6f6670db4f7d12793bf"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"989c4a2eb6a5ff2420697af52875986c08a6c42a","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _check_image(glanceclient, name, disk_format, image_type):"},{"line_number":42,"context_line":"    if re.match(r\u0027^(file|https?)://\u0027, name):"},{"line_number":43,"context_line":"        return name"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    try:"},{"line_number":46,"context_line":"        if isinstance(glanceclient, real_glance_client):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_10be66fe","line":43,"range":{"start_line":43,"start_character":8,"end_line":43,"end_character":19},"in_reply_to":"9fb8cfa7_e99ada5f","updated":"2019-06-14 07:46:37.000000000","message":"Strictly speaking, tripleo-common doesn\u0027t have to have access to any of these. Especially the file has to be accessible by ironic-conductor.","commit_id":"8245066895e0bcbc7597f6f6670db4f7d12793bf"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"d801548610996eb02616bc11fa688b1b13102c63","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        if isinstance(glanceclient, real_glance_client):"},{"line_number":47,"context_line":"            images \u003d glanceclient.images.list(name\u003dname,"},{"line_number":48,"context_line":"                                              disk_format\u003ddisk_format)"},{"line_number":49,"context_line":"            image \u003d None"},{"line_number":50,"context_line":"            for img in images:"},{"line_number":51,"context_line":"                if ((img[\u0027name\u0027] \u003d\u003d name or img[\u0027id\u0027] \u003d\u003d name) and"},{"line_number":52,"context_line":"                        img[\u0027disk_format\u0027] \u003d\u003d disk_format):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_96c4d6f6","line":49,"updated":"2019-06-11 08:56:24.000000000","message":"nit: IMO this image \u003d None can be above try: except, will be more redable (and in except will be pass simply)","commit_id":"8245066895e0bcbc7597f6f6670db4f7d12793bf"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"f254c1f63d3c53b13571c8d7d4936a502a51401a","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        if isinstance(glanceclient, real_glance_client):"},{"line_number":47,"context_line":"            images \u003d glanceclient.images.list(name\u003dname,"},{"line_number":48,"context_line":"                                              disk_format\u003ddisk_format)"},{"line_number":49,"context_line":"            image \u003d None"},{"line_number":50,"context_line":"            for img in images:"},{"line_number":51,"context_line":"                if ((img[\u0027name\u0027] \u003d\u003d name or img[\u0027id\u0027] \u003d\u003d name) and"},{"line_number":52,"context_line":"                        img[\u0027disk_format\u0027] \u003d\u003d disk_format):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_176672c2","line":49,"in_reply_to":"9fb8cfa7_96c4d6f6","updated":"2019-06-13 09:31:14.000000000","message":"Sure, I tried to make minimum changes to the existing code. I can refactor if I have to create another revision.","commit_id":"8245066895e0bcbc7597f6f6670db4f7d12793bf"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"d801548610996eb02616bc11fa688b1b13102c63","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                                              disk_format\u003ddisk_format)"},{"line_number":49,"context_line":"            image \u003d None"},{"line_number":50,"context_line":"            for img in images:"},{"line_number":51,"context_line":"                if ((img[\u0027name\u0027] \u003d\u003d name or img[\u0027id\u0027] \u003d\u003d name) and"},{"line_number":52,"context_line":"                        img[\u0027disk_format\u0027] \u003d\u003d disk_format):"},{"line_number":53,"context_line":"                    image \u003d img"},{"line_number":54,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_d95d9f15","line":51,"updated":"2019-06-11 08:56:24.000000000","message":"nit: this can be shorten: name in ((img[\u0027name\u0027], img[\u0027id\u0027])","commit_id":"8245066895e0bcbc7597f6f6670db4f7d12793bf"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"d801548610996eb02616bc11fa688b1b13102c63","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    except exceptions.NotFound:"},{"line_number":64,"context_line":"        image \u003d None"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    if image:"},{"line_number":67,"context_line":"        return image.id"},{"line_number":68,"context_line":"    else:"},{"line_number":69,"context_line":"        raise ValueError(\"%s image %s not found in Glance\" % (image_type,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_99d8877b","line":66,"updated":"2019-06-11 08:56:24.000000000","message":"nit: this can have less indented lines\n\nif not image:\n  raise ValueError(\"%s image %s not found in Glance\" % \n                    (image_type, name))\nreturn image.id","commit_id":"8245066895e0bcbc7597f6f6670db4f7d12793bf"}]}
