)]}'
{"openstack_dashboard/dashboards/admin/flavors/forms.py":[{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"10241442acaf404af707eedc3944e68c5fda67d0","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        name \u003d cleaned_data.get(\u0027name\u0027)"},{"line_number":86,"context_line":"        flavor_id \u003d cleaned_data.get(\u0027flavor_id\u0027)"},{"line_number":87,"context_line":"        try:"},{"line_number":88,"context_line":"            flavors \u003d api.nova.flavor_list(self.request)"},{"line_number":89,"context_line":"        except:"},{"line_number":90,"context_line":"            flavors \u003d []"},{"line_number":91,"context_line":"            msg \u003d _(\u0027Unable to get flavor list\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAANH%2F%2F9aE%3D","line":88,"updated":"2013-03-01 15:06:43.000000000","message":"Every time the form is validated, there will now be an extra API call to flavor_list due to this line. This is why the tests are failing.\n\nWhich is fine, it simply means that all of the tests related to editing a flavor now need an extra line that mocks flavor_list(), so that the tests don\u0027t try to call the real API.","commit_id":"68c5c8357bae165ec540ab43715232380426b3d5"},{"author":{"_account_id":1816,"name":"Gabriel Hurley","email":"gabriel.hurley@nebula.com","username":"gabriel-hurley"},"change_message_id":"1a52c7eb2f5e7df3aa157dc2ded4e02ccf9ee484","unresolved":false,"context_lines":[{"line_number":92,"context_line":"            exceptions.check_message([\"Connection\", \"refused\"], msg)"},{"line_number":93,"context_line":"            raise"},{"line_number":94,"context_line":"        # Check if there is no flavor with the same name"},{"line_number":95,"context_line":"        if flavors is not None:"},{"line_number":96,"context_line":"            for flavor in flavors:"},{"line_number":97,"context_line":"                if flavor.name \u003d\u003d name and flavor.id !\u003d flavor_id:"},{"line_number":98,"context_line":"                    raise forms.ValidationError("}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAN3%2F%2F8L8%3D","line":95,"updated":"2013-03-05 19:13:17.000000000","message":"Flavors won\u0027t be None, it would be an empty array.","commit_id":"918d4991a6b0b283932ef29550d0d617e0c08361"},{"author":{"_account_id":6413,"name":"Victoria Martinez de la Cruz","email":"victoria@redhat.com","username":"vkmc"},"change_message_id":"308a08ff0a36d7040a05e6363a3c1588cb303a87","unresolved":false,"context_lines":[{"line_number":92,"context_line":"            exceptions.check_message([\"Connection\", \"refused\"], msg)"},{"line_number":93,"context_line":"            raise"},{"line_number":94,"context_line":"        # Check if there is no flavor with the same name"},{"line_number":95,"context_line":"        if flavors is not None:"},{"line_number":96,"context_line":"            for flavor in flavors:"},{"line_number":97,"context_line":"                if flavor.name \u003d\u003d name and flavor.id !\u003d flavor_id:"},{"line_number":98,"context_line":"                    raise forms.ValidationError("}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAN3%2F%2F7%2F8%3D","line":95,"in_reply_to":"AAAAN3%2F%2F8L8%3D","updated":"2013-03-05 20:41:00.000000000","message":"This check is made because api.nova.flavor_list(self.request) returns None when there is no flavor. \n\nIt\u0027s unlikely to happen - you won\u0027t be able to edit anything if there is no flavor -, but in such case the name control is avoided.\n\nIt would be an empty array if the exception raises, but in such case it won\u0027t get any further from L#93.\n\nLet me know if I understood something wrong, thanks Gabriel :)","commit_id":"918d4991a6b0b283932ef29550d0d617e0c08361"},{"author":{"_account_id":5319,"name":"Sam Stoelinga","email":"sammiestoel@gmail.com","username":"sammiestoel"},"change_message_id":"6a7e50ab0610b696c7c1266a6ddc4eb8ee0c8919","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    disk_gb \u003d forms.IntegerField(label\u003d_(\"Root Disk GB\"))"},{"line_number":40,"context_line":"    eph_gb \u003d forms.IntegerField(label\u003d_(\"Ephemeral Disk GB\"))"},{"line_number":41,"context_line":"    swap_mb \u003d forms.IntegerField(label\u003d_(\"Swap Disk MB\"))"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def clean_name(self):"},{"line_number":44,"context_line":"        name \u003d self.cleaned_data.get(\u0027name\u0027)"},{"line_number":45,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2F7Zw%3D","line":42,"updated":"2013-03-06 03:23:49.000000000","message":"Seems here they also put in the clean_name function. So if there isn\u0027t a good reason to be inconsistent, better to also use clean_name\n\nHey? Maybe if we don\u0027t override the clean_name function we can just re-use the CreateFlavor one, would be cleaner.","commit_id":"5e4075b657e227979d0f5d1bb93ce9794f1fa240"},{"author":{"_account_id":1941,"name":"Lin Hua Cheng","email":"os.lcheng@gmail.com","username":"lin-hua-cheng"},"change_message_id":"178c0cb6de8d7ee5afce7bbff257843f6b61a3d3","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    disk_gb \u003d forms.IntegerField(label\u003d_(\"Root Disk GB\"))"},{"line_number":40,"context_line":"    eph_gb \u003d forms.IntegerField(label\u003d_(\"Ephemeral Disk GB\"))"},{"line_number":41,"context_line":"    swap_mb \u003d forms.IntegerField(label\u003d_(\"Swap Disk MB\"))"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def clean_name(self):"},{"line_number":44,"context_line":"        name \u003d self.cleaned_data.get(\u0027name\u0027)"},{"line_number":45,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2F7LM%3D","line":42,"in_reply_to":"AAAAN3%2F%2F7Zw%3D","updated":"2013-03-06 07:52:01.000000000","message":"There is a slight difference here, the flavor_id is not included in the condition.","commit_id":"5e4075b657e227979d0f5d1bb93ce9794f1fa240"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"9566a7f022aeeffb8e15780ea1786a79c9ff7d3b","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    disk_gb \u003d forms.IntegerField(label\u003d_(\"Root Disk GB\"))"},{"line_number":40,"context_line":"    eph_gb \u003d forms.IntegerField(label\u003d_(\"Ephemeral Disk GB\"))"},{"line_number":41,"context_line":"    swap_mb \u003d forms.IntegerField(label\u003d_(\"Swap Disk MB\"))"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def clean_name(self):"},{"line_number":44,"context_line":"        name \u003d self.cleaned_data.get(\u0027name\u0027)"},{"line_number":45,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2F7Cc%3D","line":42,"in_reply_to":"AAAAN3%2F%2F7Zw%3D","updated":"2013-03-06 11:20:23.000000000","message":"Unfortunately, just reusing the CreateFlavor clean_name() function would make it impossible to update a flavour without also changing its name to something new.","commit_id":"5e4075b657e227979d0f5d1bb93ce9794f1fa240"},{"author":{"_account_id":6413,"name":"Victoria Martinez de la Cruz","email":"victoria@redhat.com","username":"vkmc"},"change_message_id":"398c8f247fab6d3f807a00761cefe45e98b5e2d8","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    disk_gb \u003d forms.IntegerField(label\u003d_(\"Root Disk GB\"))"},{"line_number":40,"context_line":"    eph_gb \u003d forms.IntegerField(label\u003d_(\"Ephemeral Disk GB\"))"},{"line_number":41,"context_line":"    swap_mb \u003d forms.IntegerField(label\u003d_(\"Swap Disk MB\"))"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def clean_name(self):"},{"line_number":44,"context_line":"        name \u003d self.cleaned_data.get(\u0027name\u0027)"},{"line_number":45,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2F6NE%3D","line":42,"in_reply_to":"AAAAN3%2F%2F7Zw%3D","updated":"2013-03-06 21:29:20.000000000","message":"Yeah I thought about that when started to code the fix but, as Lin and Julie said, it just don\u0027t fit what is needed to be done here. Thanks to point it out though :)","commit_id":"5e4075b657e227979d0f5d1bb93ce9794f1fa240"},{"author":{"_account_id":5319,"name":"Sam Stoelinga","email":"sammiestoel@gmail.com","username":"sammiestoel"},"change_message_id":"6a7e50ab0610b696c7c1266a6ddc4eb8ee0c8919","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    def clean_name(self):"},{"line_number":81,"context_line":"        return self.cleaned_data[\u0027name\u0027]"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def clean(self):"},{"line_number":84,"context_line":"        cleaned_data \u003d super(EditFlavor, self).clean()"},{"line_number":85,"context_line":"        name \u003d cleaned_data.get(\u0027name\u0027)"},{"line_number":86,"context_line":"        flavor_id \u003d cleaned_data.get(\u0027flavor_id\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2F7aE%3D","line":83,"updated":"2013-03-06 03:23:49.000000000","message":"This code looks good, just thought it would be better to place this in clean_name then the error would also be placed above the name field. Which would be better imo.","commit_id":"5e4075b657e227979d0f5d1bb93ce9794f1fa240"},{"author":{"_account_id":1941,"name":"Lin Hua Cheng","email":"os.lcheng@gmail.com","username":"lin-hua-cheng"},"change_message_id":"178c0cb6de8d7ee5afce7bbff257843f6b61a3d3","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    def clean_name(self):"},{"line_number":81,"context_line":"        return self.cleaned_data[\u0027name\u0027]"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def clean(self):"},{"line_number":84,"context_line":"        cleaned_data \u003d super(EditFlavor, self).clean()"},{"line_number":85,"context_line":"        name \u003d cleaned_data.get(\u0027name\u0027)"},{"line_number":86,"context_line":"        flavor_id \u003d cleaned_data.get(\u0027flavor_id\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2F7LQ%3D","line":83,"in_reply_to":"AAAAN3%2F%2F7aE%3D","updated":"2013-03-06 07:52:01.000000000","message":"I think the reason this is here is because the validation is performed using the two fields name and flavor_id.","commit_id":"5e4075b657e227979d0f5d1bb93ce9794f1fa240"}],"openstack_dashboard/dashboards/admin/flavors/tests.py":[{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"618bbe03ac45aa95d6083fcdd177f6a1767fcee4","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        flavor_b \u003d self.flavors.list()[1]"},{"line_number":172,"context_line":"        eph \u003d getattr(flavor_a, \u0027OS-FLV-EXT-DATA:ephemeral\u0027)"},{"line_number":173,"context_line":"        extra_specs \u003d getattr(flavor_a, \u0027extra_specs\u0027)"},{"line_number":174,"context_line":"        new_flavor \u003d flavors.Flavor(flavors.FlavorManager(None),"},{"line_number":175,"context_line":"                                    {\u0027id\u0027:"},{"line_number":176,"context_line":"                                     \"cccccccc-cccc-cccc-cccc-cccccccccccc\","},{"line_number":177,"context_line":"                                     \u0027name\u0027: flavor_b.name,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAN3%2F%2F814%3D","line":174,"updated":"2013-03-05 15:05:19.000000000","message":"Note: This test does not create a new flavour so this variable is not needed","commit_id":"cc0510588bcdb9d3b31b9ad62070b07bffd04d58"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"618bbe03ac45aa95d6083fcdd177f6a1767fcee4","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                            flavor_a.id).AndReturn(flavor_a)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        # POST"},{"line_number":190,"context_line":"        api.nova.flavor_list(IsA(http.HttpRequest))"},{"line_number":191,"context_line":"        api.nova.flavor_get(IsA(http.HttpRequest),"},{"line_number":192,"context_line":"                            flavor_a.id).AndReturn(flavor_a)"},{"line_number":193,"context_line":"        api.nova.flavor_get_extras(IsA(http.HttpRequest),"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAN3%2F%2F81Y%3D","line":190,"updated":"2013-03-05 15:05:19.000000000","message":"The problem is here: flavor_list() is mocked but doesn\u0027t return anything -- that is, it returns None.\n\nThis means that when in forms.py clean() code, the api.nova.flavor_list() method is called, mox will return \u0027None\u0027, so the code for comparing flavor names with existing ones will not be run (there is a check for None at line 95).\n\nThis should be:\n\n        api.nova.flavor_list(IsA(http.HttpRequest)).AndReturn(self.flavors.list())","commit_id":"cc0510588bcdb9d3b31b9ad62070b07bffd04d58"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"618bbe03ac45aa95d6083fcdd177f6a1767fcee4","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                                   flavor_a.id,"},{"line_number":195,"context_line":"                                   raw\u003dTrue).AndReturn(extra_specs)"},{"line_number":196,"context_line":"        api.nova.flavor_delete(IsA(http.HttpRequest), flavor_a.id)"},{"line_number":197,"context_line":"        api.nova.flavor_create(IsA(http.HttpRequest),"},{"line_number":198,"context_line":"                               new_flavor.name,"},{"line_number":199,"context_line":"                               new_flavor.ram,"},{"line_number":200,"context_line":"                               new_flavor.vcpus,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAN3%2F%2F810%3D","line":197,"updated":"2013-03-05 15:05:19.000000000","message":"Note: Line 196 and 197 are not needed either since this test should not go that far into the code.","commit_id":"cc0510588bcdb9d3b31b9ad62070b07bffd04d58"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"31879869800ccca1c623dc28e5d4a0d1aa42e672","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        flavor_b \u003d self.flavors.list()[1]"},{"line_number":170,"context_line":"        eph \u003d getattr(flavor_a, \u0027OS-FLV-EXT-DATA:ephemeral\u0027)"},{"line_number":171,"context_line":"        extra_specs \u003d getattr(flavor_a, \u0027extra_specs\u0027)"},{"line_number":172,"context_line":"        flavors.Flavor(flavors.FlavorManager(None),"},{"line_number":173,"context_line":"                       {\u0027id\u0027:"},{"line_number":174,"context_line":"                            \"cccccccc-cccc-cccc-cccc-cccccccccccc\","},{"line_number":175,"context_line":"                        \u0027name\u0027: flavor_b.name,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAN3%2F%2F7xo%3D","line":172,"updated":"2013-03-05 22:28:03.000000000","message":"This isn\u0027t used anywhere and doesn\u0027t appear to be needed for the test.","commit_id":"918d4991a6b0b283932ef29550d0d617e0c08361"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"9566a7f022aeeffb8e15780ea1786a79c9ff7d3b","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    @test.create_stubs({api.nova: (\u0027flavor_list\u0027,"},{"line_number":163,"context_line":"                                   \u0027flavor_create\u0027,"},{"line_number":164,"context_line":"                                   \u0027flavor_delete\u0027,"},{"line_number":165,"context_line":"                                   \u0027flavor_get_extras\u0027,"},{"line_number":166,"context_line":"                                   \u0027flavor_get\u0027), })"},{"line_number":167,"context_line":"    def test_edit_flavor_set_existing_name(self):"},{"line_number":168,"context_line":"        flavor_a \u003d self.flavors.list()[0]"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2F7AU%3D","line":165,"updated":"2013-03-06 11:20:23.000000000","message":"flavor_create / delete / get_extras aren\u0027t mocked in this test and could safely be removed","commit_id":"5e4075b657e227979d0f5d1bb93ce9794f1fa240"},{"author":{"_account_id":6413,"name":"Victoria Martinez de la Cruz","email":"victoria@redhat.com","username":"vkmc"},"change_message_id":"398c8f247fab6d3f807a00761cefe45e98b5e2d8","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    @test.create_stubs({api.nova: (\u0027flavor_list\u0027,"},{"line_number":163,"context_line":"                                   \u0027flavor_create\u0027,"},{"line_number":164,"context_line":"                                   \u0027flavor_delete\u0027,"},{"line_number":165,"context_line":"                                   \u0027flavor_get_extras\u0027,"},{"line_number":166,"context_line":"                                   \u0027flavor_get\u0027), })"},{"line_number":167,"context_line":"    def test_edit_flavor_set_existing_name(self):"},{"line_number":168,"context_line":"        flavor_a \u003d self.flavors.list()[0]"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2F6NA%3D","line":165,"in_reply_to":"AAAAN3%2F%2F7AU%3D","updated":"2013-03-06 21:29:20.000000000","message":"Agree, we could optimize this code even more :) Thanks","commit_id":"5e4075b657e227979d0f5d1bb93ce9794f1fa240"},{"author":{"_account_id":4978,"name":"Julie Pichon","email":"jpichon@redhat.com","username":"jpichon"},"change_message_id":"9566a7f022aeeffb8e15780ea1786a79c9ff7d3b","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        flavor_a \u003d self.flavors.list()[0]"},{"line_number":169,"context_line":"        flavor_b \u003d self.flavors.list()[1]"},{"line_number":170,"context_line":"        eph \u003d getattr(flavor_a, \u0027OS-FLV-EXT-DATA:ephemeral\u0027)"},{"line_number":171,"context_line":"        extra_specs \u003d getattr(flavor_a, \u0027extra_specs\u0027)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        # GET"},{"line_number":174,"context_line":"        api.nova.flavor_get(IsA(http.HttpRequest),"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2F7Ak%3D","line":171,"updated":"2013-03-06 11:20:23.000000000","message":"Another nit, but extra_specs isn\u0027t used anywhere anymore","commit_id":"5e4075b657e227979d0f5d1bb93ce9794f1fa240"},{"author":{"_account_id":6413,"name":"Victoria Martinez de la Cruz","email":"victoria@redhat.com","username":"vkmc"},"change_message_id":"398c8f247fab6d3f807a00761cefe45e98b5e2d8","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        flavor_a \u003d self.flavors.list()[0]"},{"line_number":169,"context_line":"        flavor_b \u003d self.flavors.list()[1]"},{"line_number":170,"context_line":"        eph \u003d getattr(flavor_a, \u0027OS-FLV-EXT-DATA:ephemeral\u0027)"},{"line_number":171,"context_line":"        extra_specs \u003d getattr(flavor_a, \u0027extra_specs\u0027)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        # GET"},{"line_number":174,"context_line":"        api.nova.flavor_get(IsA(http.HttpRequest),"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2F6M4%3D","line":171,"in_reply_to":"AAAAN3%2F%2F7Ak%3D","updated":"2013-03-06 21:29:20.000000000","message":"Done","commit_id":"5e4075b657e227979d0f5d1bb93ce9794f1fa240"}]}
