)]}'
{"glance/api/v2/image_data.py":[{"author":{"_account_id":16137,"name":"Tobias Urdin","email":"tobias.urdin@binero.com","username":"tobasco"},"change_message_id":"50540b73ec43e7b336d8440fa4b44d4a7ae8f018","unresolved":true,"context_lines":[{"line_number":163,"context_line":"                image.set_data(data, size, backend\u003dbackend)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"                # Inject metadata properties"},{"line_number":166,"context_line":"                property_utils.inject_metadata_properties(image, roles)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"                try:"},{"line_number":169,"context_line":"                    image_repo.save(image, from_state\u003d\u0027saving\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"17708a75_9f15a763","line":166,"updated":"2022-10-21 09:59:53.000000000","message":"TODO: this need more unit testing","commit_id":"8177f388c79f30970b16e315ddfeb133f98005f7"}],"glance/common/property_utils.py":[{"author":{"_account_id":16137,"name":"Tobias Urdin","email":"tobias.urdin@binero.com","username":"tobasco"},"change_message_id":"50540b73ec43e7b336d8440fa4b44d4a7ae8f018","unresolved":true,"context_lines":[{"line_number":270,"context_line":"            if overwrite or key not in image.extra_properties:"},{"line_number":271,"context_line":"                image.extra_properties[key] \u003d value"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"def inject_metadata_properties(image, user_roles):"},{"line_number":275,"context_line":"    \"\"\"Inject metadata properties to image"},{"line_number":276,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"42df5cb3_a1886498","line":273,"updated":"2022-10-21 09:59:53.000000000","message":"TODO: this func needs unit testing","commit_id":"8177f388c79f30970b16e315ddfeb133f98005f7"},{"author":{"_account_id":16137,"name":"Tobias Urdin","email":"tobias.urdin@binero.com","username":"tobasco"},"change_message_id":"50540b73ec43e7b336d8440fa4b44d4a7ae8f018","unresolved":true,"context_lines":[{"line_number":290,"context_line":"            # applied on an image already containing properties"},{"line_number":291,"context_line":"            # that the user has set on the image."},{"line_number":292,"context_line":"            set_image_extra_properties(image, properties,"},{"line_number":293,"context_line":"                                       overwrite\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":1,"id":"942a67ae_5d635c5c","line":293,"range":{"start_line":293,"start_character":39,"end_line":293,"end_character":54},"updated":"2022-10-21 09:59:53.000000000","message":"This is the thing I have the most question regarding. What I want is in the upload and import paths I want the inject metadata code to add a default property that will be overridden if a user supplies that property.\n\nI don\u0027t want the logic to impose any change on the property protection part so that should still be enforced on the end-users set properties.\n\nSo I\u0027m thinking here, maybe this should still be overwrite\u003dTrue as the default and we should introduce a new logic into the inject metadata code with a config opt like [inject_metadata_properties]/default that would be operators default properties for images that could be overriden (or not, based on property protections)\n\nWhat do you think?\n\nI will give a quick example, I have custom_os_type property on images, I want all end-user uploaded images to have custom_os_type\u003dother unless custom_os_type is provided by an end-user.\n\nBy default I would not use property protection for custom_os_type so an end-user is allowed to give custom_os_type property that would override the default \"other\" value.","commit_id":"8177f388c79f30970b16e315ddfeb133f98005f7"},{"author":{"_account_id":16137,"name":"Tobias Urdin","email":"tobias.urdin@binero.com","username":"tobasco"},"change_message_id":"f182e016e705079683891d82ce76399843871e21","unresolved":true,"context_lines":[{"line_number":290,"context_line":"            # applied on an image already containing properties"},{"line_number":291,"context_line":"            # that the user has set on the image."},{"line_number":292,"context_line":"            set_image_extra_properties(image, properties,"},{"line_number":293,"context_line":"                                       overwrite\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7cd0edb8_899e97bd","line":293,"range":{"start_line":293,"start_character":39,"end_line":293,"end_character":54},"in_reply_to":"942a67ae_5d635c5c","updated":"2022-10-23 20:34:27.000000000","message":"Thinking about it, I think what I want is to set default properties on an image when it\u0027s created before end-user metadata is applied. But I\u0027m not sure if what I want is the previous patch *and* this patch or just one of them.","commit_id":"8177f388c79f30970b16e315ddfeb133f98005f7"}]}
