)]}'
{"openstack_dashboard/dashboards/project/instances/workflows/create_instance.py":[{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"42497672f2d10c7efa59306cf862634736d9a673","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        source \u003d cleaned_data[\u0027source_type\u0027]"},{"line_number":200,"context_line":"        # There should always be at least one image_id choice, telling the user"},{"line_number":201,"context_line":"        # that there are \"No Images Available\" so we check for 2 here..."},{"line_number":202,"context_line":"        if source \u003d\u003d \u0027image_id\u0027 and not \\"},{"line_number":203,"context_line":"                filter(lambda x: x[0] !\u003d \u0027\u0027, self.fields[\u0027image_id\u0027].choices):"},{"line_number":204,"context_line":"            raise forms.ValidationError(_(\"There are no image sources \""},{"line_number":205,"context_line":"                                          \"available; you must first create \""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2F0uU%3D","line":202,"updated":"2013-05-22 08:31:30.000000000","message":"This also needs a check - if no image is registered in the system, but you choose to boot from volume, this will still raise a validation error. I think if there is a volume_type selected, the source variable should be set to None/empty, as it doesn\u0027t make sense in this case, as you noted in the bug description. So we clearly have two validation paths here - volume_type or source. And source should be validated only if there is no volume_type, and vice versa.","commit_id":"9f5020b8ec0b71a15c5d348a9ab3558a04b61441"},{"author":{"_account_id":5319,"name":"Sam Stoelinga","email":"sammiestoel@gmail.com","username":"sammiestoel"},"change_message_id":"e857aef5881d007cfb2f3ce4df9aa5d3f75616f8","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        source \u003d cleaned_data[\u0027source_type\u0027]"},{"line_number":200,"context_line":"        # There should always be at least one image_id choice, telling the user"},{"line_number":201,"context_line":"        # that there are \"No Images Available\" so we check for 2 here..."},{"line_number":202,"context_line":"        if source \u003d\u003d \u0027image_id\u0027 and not \\"},{"line_number":203,"context_line":"                filter(lambda x: x[0] !\u003d \u0027\u0027, self.fields[\u0027image_id\u0027].choices):"},{"line_number":204,"context_line":"            raise forms.ValidationError(_(\"There are no image sources \""},{"line_number":205,"context_line":"                                          \"available; you must first create \""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2FyTk%3D","line":202,"in_reply_to":"AAAAPH%2F%2F0uU%3D","updated":"2013-05-23 02:11:56.000000000","message":"Actually it may make sense if somebody only wants to boot from the ramdisk and kernel from the image. So thats why I choose to still support this in the end. If you still think it doesn\u0027t make sense I will remove it, I think it\u0027s confusing to support it also as most people wont use it and the result may be different from what they expect. I just didn\u0027t want to break this functionality without conformation.\n\nAlso if we choose to not support booting form volume and specifying an image, we shouldn\u0027t just set tit to None/empty but we should tell them \"You can\u0027t specify an image when booting from Volume\". I don\u0027t think its nice to do some hidden magic he chooses it and it just doesn\u0027t get used, he won\u0027t know whats going on.\n\nYou\u0027re right on the part that it should also work if there are no image sources available. Will update this in the next patch.\n\nThanks for your review :D","commit_id":"9f5020b8ec0b71a15c5d348a9ab3558a04b61441"},{"author":{"_account_id":5319,"name":"Sam Stoelinga","email":"sammiestoel@gmail.com","username":"sammiestoel"},"change_message_id":"1059354e8ebcda9b35db6560c7ac5c5ddb2c2046","unresolved":false,"context_lines":[{"line_number":211,"context_line":"        if not cleaned_data[source] and not volume_type:"},{"line_number":212,"context_line":"            raise forms.ValidationError(_(\"Please select an option for the \""},{"line_number":213,"context_line":"                                          \"instance source.\"))"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        if cleaned_data[source] and volume_type:"},{"line_number":216,"context_line":"             raise forms.ValidationError(_(\"You can\u0027t select an instance \""},{"line_number":217,"context_line":"                                           \"source when booting from a \""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPH%2F%2FvLw%3D","line":214,"updated":"2013-05-24 03:39:05.000000000","message":"This patch also disables booting from volume with an image specified. Nova supports this though and maybe somebody would like to use the ramdisk / kernel from the image  but boot from volume? If this is a common usecase, this validation should be removed.","commit_id":"50fa0c1d8c5f68d6bba031a3b03226d1feecc4a3"},{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"9dc2a468b10d344076d34010f881d29310f556bc","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        volume_type \u003d self.data.get(\u0027volume_type\u0027, None)"},{"line_number":203,"context_line":"        if source \u003d\u003d \u0027image_id\u0027 and not \\"},{"line_number":204,"context_line":"                filter(lambda x: x[0] !\u003d \u0027\u0027, self.fields[\u0027image_id\u0027].choices) \\"},{"line_number":205,"context_line":"                and not volume_type:"},{"line_number":206,"context_line":"            raise forms.ValidationError(_(\"There are no image sources \""},{"line_number":207,"context_line":"                                          \"available; you must first create \""},{"line_number":208,"context_line":"                                          \"an image before attempting to \""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPH%2F%2FuvQ%3D","line":205,"updated":"2013-05-24 09:27:51.000000000","message":"The validation logic here is too scattered. Why not doing it in that way:\n\n    if volume_type: # boot from volume selected\n        if cleaned_data[source]:\n            raise (Both image/snapshot and volume are selected...)\n    else: # boot from image selected\n        if not filter (...): # \n            raise (No image sources available)\n        elif not cleaned_data[source]: # here we have available images but nothing is selected\n            raise No source selected\n\nThis makes it much more readable for the two different cases that we have here - boot from image or volume.","commit_id":"62bf902e2089323915fe597ee53d6df9ee2e9d93"}]}
