)]}'
{"openstack_dashboard/dashboards/project/stacks/forms.py":[{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"7950f329e32b58d94def4ba47e0641683ee77ee1","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            # there is now two valid syntax to define allowed_values"},{"line_number":223,"context_line":"            if allowed_values:"},{"line_number":224,"context_line":"                choices \u003d ["},{"line_number":225,"context_line":"                    (param.get(\u0027Default\u0027, None), param.get(\u0027Default\u0027, None))"},{"line_number":226,"context_line":"                ]"},{"line_number":227,"context_line":"                choices +\u003d [(choice, choice) for choice in allowed_values]"},{"line_number":228,"context_line":"                field \u003d forms.ChoiceField(choices\u003dchoices)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F8yJ4%3D","line":225,"updated":"2013-12-20 11:11:01.000000000","message":"Is the \u0027Default\u0027 field mandatory for a param and how will the first choice look like if there is no \u0027Default\u0027 in the param? I mean the rendering on the page. Maybe it will be better to not append this to choices if there is no Default?","commit_id":"47a39702c5c5136a94ac121c2b79c0abee52acfb"},{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"dcdbb82ddaa6907deaef29c846ef67a2cd436d46","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                if default:"},{"line_number":226,"context_line":"                    if default in allowed_values:"},{"line_number":227,"context_line":"                        allowed_values.remove(default)"},{"line_number":228,"context_line":"                    allowed_values.insert(0, default)"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"                field \u003d forms.ChoiceField("},{"line_number":231,"context_line":"                    choices\u003d[(choice, choice) for choice in allowed_values])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F8wvM%3D","line":228,"updated":"2013-12-20 15:39:18.000000000","message":"Is it possible that \u0027default\u0027 is not in \u0027allowed_values\u0027? In this case it will be added here.","commit_id":"676ba88f1508bae1c4b2ca8b753da02f62d14e5c"},{"author":{"_account_id":8429,"name":"Jordan OMara","email":"jomara@redhat.com","username":"jomara"},"change_message_id":"cc438509f923c1ba8c99cf7efc25688b2e7a8549","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                if default:"},{"line_number":226,"context_line":"                    if default in allowed_values:"},{"line_number":227,"context_line":"                        allowed_values.remove(default)"},{"line_number":228,"context_line":"                    allowed_values.insert(0, default)"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"                field \u003d forms.ChoiceField("},{"line_number":231,"context_line":"                    choices\u003d[(choice, choice) for choice in allowed_values])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F8vME%3D","line":228,"in_reply_to":"AAAATn%2F8wZM%3D","updated":"2013-12-20 21:23:36.000000000","message":"What do you think about splitting these two different param types into different methods","commit_id":"676ba88f1508bae1c4b2ca8b753da02f62d14e5c"},{"author":{"_account_id":7976,"name":"Maxime Vidori","email":"mvidori@redhat.com","username":"MaxV"},"change_message_id":"ead72c0dd155c84934694a0c184d2bb3907d683b","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                if default:"},{"line_number":226,"context_line":"                    if default in allowed_values:"},{"line_number":227,"context_line":"                        allowed_values.remove(default)"},{"line_number":228,"context_line":"                    allowed_values.insert(0, default)"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"                field \u003d forms.ChoiceField("},{"line_number":231,"context_line":"                    choices\u003d[(choice, choice) for choice in allowed_values])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F8wZM%3D","line":228,"in_reply_to":"AAAATn%2F8wvM%3D","updated":"2013-12-20 16:32:42.000000000","message":"Yes, it is possible that the default is not in allowed_values, this is a valid template:\n\n     instance_type:\n          type: string\n          default: m2.medium\n          constraints:\n              allowed_values:\n                  - m1.small\n                  - m1.medium\n                  - m1.largem1.tiny","commit_id":"676ba88f1508bae1c4b2ca8b753da02f62d14e5c"},{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"352c13e789d3891dacbbec75ea6f3322325a72ee","unresolved":false,"context_lines":[{"line_number":207,"context_line":"                if default:"},{"line_number":208,"context_line":"                    if default in allowed_values:"},{"line_number":209,"context_line":"                        allowed_values.remove(default)"},{"line_number":210,"context_line":"                    allowed_values.insert(0, default)"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"                return forms.ChoiceField("},{"line_number":213,"context_line":"                    choices\u003d[(choice, choice) for choice in allowed_values])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAT3%2F%2F5wI%3D","line":210,"updated":"2013-12-27 13:52:11.000000000","message":"I still cannot understand why default should be added in the case it doesn\u0027t appear in the allowed values, which is possible here? Which one has preference - allowed values or the default? Why should \u0027default\u0027 override the allowed values constrains?","commit_id":"792b07406d118b9bb1b8a012c71f9b3df4d732ee"},{"author":{"_account_id":7976,"name":"Maxime Vidori","email":"mvidori@redhat.com","username":"MaxV"},"change_message_id":"0e94d88c5d5a8d988993cee5e75b2e301b99662f","unresolved":false,"context_lines":[{"line_number":207,"context_line":"                if default:"},{"line_number":208,"context_line":"                    if default in allowed_values:"},{"line_number":209,"context_line":"                        allowed_values.remove(default)"},{"line_number":210,"context_line":"                    allowed_values.insert(0, default)"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"                return forms.ChoiceField("},{"line_number":213,"context_line":"                    choices\u003d[(choice, choice) for choice in allowed_values])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAT3%2F%2F5iQ%3D","line":210,"in_reply_to":"AAAAT3%2F%2F5wI%3D","updated":"2013-12-27 15:02:29.000000000","message":"You will have a dropdown of possibilities, if default is not in allowed values you will just can not select it as an option (it is still a valid template I checked). I made a deletion and re-add to force the default option to be the first one displayed, so if the user click submit it will be the default.\n\nDo you want me to add a code comment to explain this, to ease the maintainability?","commit_id":"792b07406d118b9bb1b8a012c71f9b3df4d732ee"},{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"352c13e789d3891dacbbec75ea6f3322325a72ee","unresolved":false,"context_lines":[{"line_number":215,"context_line":"            if param_type in (\u0027CommaDelimitedList\u0027, \u0027String\u0027):"},{"line_number":216,"context_line":"                if \u0027MinLength\u0027 in parameter:"},{"line_number":217,"context_line":"                    field_args[\u0027min_length\u0027] \u003d int(parameter[\u0027MinLength\u0027])"},{"line_number":218,"context_line":"                    field_args[\u0027required\u0027] \u003d parameter.get(\u0027MinLength\u0027, 0) \u003e 0"},{"line_number":219,"context_line":"                if \u0027MaxLength\u0027 in parameter:"},{"line_number":220,"context_line":"                    field_args[\u0027max_length\u0027] \u003d int(parameter[\u0027MaxLength\u0027])"},{"line_number":221,"context_line":"                return forms.CharField(**field_args)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAT3%2F%2F5wY%3D","line":218,"updated":"2013-12-27 13:52:11.000000000","message":"the .get() here is redundant, as this is executed `if \u0027MinLength\u0027 in parameter\u0027`. But what if parameter[\u0027MinLength\u0027] is a string? \u00270\u0027 is greater than 0. I guess \n\n    field_args[\u0027min_length\u0027] \u003e 0\n\nwill be better to use here, as it is already parsed to integer.","commit_id":"792b07406d118b9bb1b8a012c71f9b3df4d732ee"},{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"fd5f3b743fd1c40faf51f00c25095f0dc21a200c","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        def process_param(parameter):"},{"line_number":200,"context_line":"            param_type \u003d parameter.get(\u0027Type\u0027)"},{"line_number":201,"context_line":"            # there is now two valid syntax to define allowed_values"},{"line_number":202,"context_line":"            allowed_values \u003d parameter.get(\u0027constraints\u0027, {}).get("},{"line_number":203,"context_line":"                \u0027allowed_values\u0027, []) or parameter.get(\u0027AllowedValues\u0027)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"            if allowed_values:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAT3%2F%2FxME%3D","line":202,"updated":"2014-01-01 23:43:35.000000000","message":"I did a brief test with this template:\n\n    https://raw.github.com/openstack/heat-templates/master/hot/F18/NovaInstanceWithCinderVolume_Native.yaml\n\nand got an error: \n\n    \u0027list\u0027 object has no attribute \u0027get\u0027\n\n\nIt seems \n\n    u\u0027constraints\u0027: [{u\u0027allowed_values\u0027: [u\u0027F18-i386-cfntools\u0027, u\u0027F18-x86_64-cfntools\u0027],\n           u\u0027description\u0027: u\u0027Image ID must be either F18-i386-cfntools or F18-x86_64-cfntools.\u0027}]}\n\nis a list, while here it is assumed to be a Dict. And according to this:\n\n    https://github.com/openstack/heat/blob/master/heat/engine/constraints.py#L37\n\nIt should be a List. Hence the test data in the patch is not following the template schema.\n\nAlso I still do not agree that we should show the default value in the dropdown if it is not among the allowed values. According to the test I\u0027ve made, I can select the Default value, which is not in allowed_values, and when I submit the stack, I get in the log:\n\n    2014-01-02 01:35:54.619 TRACE heat.openstack.common.rpc.amqp ValueError: image_id Image ID must be either F18-i386-cfntools or F18-x86_64-cfntools.\n\nSo I don\u0027t see a reason to show in the form a value that cannot be submitted. Not to mention that at the moment the only error that is shown in Dashboard is \"Error: Stack creation failed\", which doesn\u0027t give any explanation to the problem.","commit_id":"1ca4d0db6e17c53abbb2e55a0b311bbe02359640"},{"author":{"_account_id":6966,"name":"Jeffrey J. Walls","email":"jeff.walls@hpe.com","username":"ftcjeff"},"change_message_id":"87479c76af9af16be50b2808c9b34e971274dda8","unresolved":false,"context_lines":[{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    def _build_parameter_fields(self, template_validate):"},{"line_number":201,"context_line":"        def process_field_args(parameter, label):"},{"line_number":202,"context_line":"            # there is two valid syntax in Heat, we have to manipulate both"},{"line_number":203,"context_line":"            constraints \u003d parameter.get(\u0027constraints\u0027, [])"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"            field_args \u003d {"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FFBM%3D","line":202,"updated":"2014-01-17 16:53:47.000000000","message":"I would say: There are two valid syntaxes in Heat...","commit_id":"c69e2d9371a9550513fab36820296db62894b6eb"}],"openstack_dashboard/dashboards/project/stacks/tests.py":[{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"7950f329e32b58d94def4ba47e0641683ee77ee1","unresolved":false,"context_lines":[{"line_number":214,"context_line":"            res.context_data[\u0027form\u0027].fields[\u0027__param_InstanceType\u0027],"},{"line_number":215,"context_line":"            fields.ChoiceField"},{"line_number":216,"context_line":"        )"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"class TemplateFormTests(test.TestCase):"},{"line_number":220,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F8yIs%3D","line":217,"updated":"2013-12-20 11:11:01.000000000","message":"Would you please add a simple assert for let\u0027s say the first ChoiceField value?","commit_id":"47a39702c5c5136a94ac121c2b79c0abee52acfb"}]}
