)]}'
{"rally/plugins/openstack/validators.py":[{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"2e794e30148bde9dfce12ed63da38bcd3d3ac0bb","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    \"\"\""},{"line_number":42,"context_line":"    def decorator(func):"},{"line_number":43,"context_line":"        def wrapper(*args, **kw):"},{"line_number":44,"context_line":"            add_role \u003d False"},{"line_number":45,"context_line":"            func_type \u003d inspect.getcallargs(func, *args, **kw)"},{"line_number":46,"context_line":"            if func_type.get(\"config\", {}).get("}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_e812a3b1","line":43,"range":{"start_line":43,"start_character":20,"end_line":43,"end_character":31},"updated":"2018-01-11 18:31:29.000000000","message":"you can change this by `self, context, config, plugin_cls, plugin_cfg`, so no inspect should be required","commit_id":"c0db0197322c06c1ae30d9c36030b6e80b640bcb"},{"author":{"_account_id":26025,"name":"chenxu","email":"xuchen1990xx@gmail.com","username":"chenxu"},"change_message_id":"25f2a2b0151bc9771c47b56519c45ca184426be4","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    \"\"\""},{"line_number":42,"context_line":"    def decorator(func):"},{"line_number":43,"context_line":"        def wrapper(*args, **kw):"},{"line_number":44,"context_line":"            add_role \u003d False"},{"line_number":45,"context_line":"            func_type \u003d inspect.getcallargs(func, *args, **kw)"},{"line_number":46,"context_line":"            if func_type.get(\"config\", {}).get("}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_f33b44c5","line":43,"range":{"start_line":43,"start_character":20,"end_line":43,"end_character":31},"in_reply_to":"7f96bb07_e812a3b1","updated":"2018-01-14 08:36:34.000000000","message":"Hi ,Andrey. I think about using these parameters. but if we change the input of \"validate\" later or add a new \"validate\" with different input , if using inspect is more compatible ?  : )","commit_id":"c0db0197322c06c1ae30d9c36030b6e80b640bcb"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"2e794e30148bde9dfce12ed63da38bcd3d3ac0bb","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                roles.RoleGenerator(func_type[\"context\"]).setup()"},{"line_number":51,"context_line":"                add_role \u003d True"},{"line_number":52,"context_line":"            func(*args, **kw)"},{"line_number":53,"context_line":"            if add_role:"},{"line_number":54,"context_line":"                roles.RoleGenerator(func_type[\"context\"]).cleanup()"},{"line_number":55,"context_line":"        return wrapper"},{"line_number":56,"context_line":"    return decorator"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_e8606335","line":54,"range":{"start_line":53,"start_character":12,"end_line":54,"end_character":67},"updated":"2018-01-11 18:31:29.000000000","message":"the validator can fail, it is ok. In this case, cleanup should be performed as well.\n\nIt looks like context class implements `context manager` in python terms, i.e we can do something like:\n\n  if (...):\n      with roles.RoleGenerator(func_type[\"context\"]):\n          func(...)\n  else:\n      func(...)","commit_id":"c0db0197322c06c1ae30d9c36030b6e80b640bcb"},{"author":{"_account_id":26025,"name":"chenxu","email":"xuchen1990xx@gmail.com","username":"chenxu"},"change_message_id":"25f2a2b0151bc9771c47b56519c45ca184426be4","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                roles.RoleGenerator(func_type[\"context\"]).setup()"},{"line_number":51,"context_line":"                add_role \u003d True"},{"line_number":52,"context_line":"            func(*args, **kw)"},{"line_number":53,"context_line":"            if add_role:"},{"line_number":54,"context_line":"                roles.RoleGenerator(func_type[\"context\"]).cleanup()"},{"line_number":55,"context_line":"        return wrapper"},{"line_number":56,"context_line":"    return decorator"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f96bb07_733174a2","line":54,"range":{"start_line":53,"start_character":12,"end_line":54,"end_character":67},"in_reply_to":"7f96bb07_e8606335","updated":"2018-01-14 08:36:34.000000000","message":"Contextmanager looks like not run function \"setup\" in __enter__ and I should still call it here .  https://github.com/openstack/rally/blob/master/rally/task/context.py#164","commit_id":"c0db0197322c06c1ae30d9c36030b6e80b640bcb"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"c2caf23404674e975cbf866aac22353c1774bfda","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    def decorator(func):"},{"line_number":43,"context_line":"        def wrapper(*args, **kw):"},{"line_number":44,"context_line":"            func_type \u003d inspect.getcallargs(func, *args, **kw)"},{"line_number":45,"context_line":"            if func_type.get(\"config\", {}).get(\"contexts\", {}).get(\"roles\"):"},{"line_number":46,"context_line":"                func_type[\"context\"][\"config\"] \u003d func_type["},{"line_number":47,"context_line":"                    \"config\"][\"contexts\"]"},{"line_number":48,"context_line":"                rolegenerator \u003d roles.RoleGenerator(func_type[\"context\"])"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_2db6798c","line":45,"range":{"start_line":45,"start_character":12,"end_line":45,"end_character":76},"updated":"2018-01-19 11:12:54.000000000","message":"we need to check here that we have an admin user, otherwise roles context will fail","commit_id":"cc9206003f0df634c80d55876a000127e0648507"},{"author":{"_account_id":26025,"name":"chenxu","email":"xuchen1990xx@gmail.com","username":"chenxu"},"change_message_id":"acf0d0f10ad8c61783d8bac7df645432ceba0f94","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    def decorator(func):"},{"line_number":43,"context_line":"        def wrapper(*args, **kw):"},{"line_number":44,"context_line":"            func_type \u003d inspect.getcallargs(func, *args, **kw)"},{"line_number":45,"context_line":"            if func_type.get(\"config\", {}).get(\"contexts\", {}).get(\"roles\"):"},{"line_number":46,"context_line":"                func_type[\"context\"][\"config\"] \u003d func_type["},{"line_number":47,"context_line":"                    \"config\"][\"contexts\"]"},{"line_number":48,"context_line":"                rolegenerator \u003d roles.RoleGenerator(func_type[\"context\"])"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_4b8c8ad6","line":45,"range":{"start_line":45,"start_character":12,"end_line":45,"end_character":76},"in_reply_to":"7f96bb07_2db6798c","updated":"2018-01-24 14:53:05.000000000","message":"Done","commit_id":"cc9206003f0df634c80d55876a000127e0648507"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"9eb10357c9406bf6af97e5c4c005ee6bc35cd189","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    def decorator(func):"},{"line_number":43,"context_line":"        def wrapper(*args, **kw):"},{"line_number":44,"context_line":"            func_type \u003d inspect.getcallargs(func, *args, **kw)"},{"line_number":45,"context_line":"            if func_type.get(\"config\", {}).get(\"contexts\", {}).get(\"roles\") \\"},{"line_number":46,"context_line":"                    and func_type.get(\"context\", {}).get(\"admin\", {}.get("},{"line_number":47,"context_line":"                        \"credential\")):"},{"line_number":48,"context_line":"                func_type[\"context\"][\"config\"] \u003d func_type["},{"line_number":49,"context_line":"                    \"config\"][\"contexts\"]"},{"line_number":50,"context_line":"                rolegenerator \u003d roles.RoleGenerator(func_type[\"context\"])"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_cea66810","line":47,"range":{"start_line":45,"start_character":12,"end_line":47,"end_character":39},"updated":"2018-01-24 15:02:48.000000000","message":"let\u0027s simplify this.:\n\n   ctx \u003d func_type.get(\"config\", {}).get(\"contexts\", {})\n   if ctx.get(\"roles\") and ctext.get(\"admin\"):\n       # do stuff","commit_id":"b5e3af3bdbfd541e55bccb151bc747ed3fb7ac8a"},{"author":{"_account_id":26025,"name":"chenxu","email":"xuchen1990xx@gmail.com","username":"chenxu"},"change_message_id":"33e7fd3b76fcbd4f07fc06264bfeb7e69ce9ecf6","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    def decorator(func):"},{"line_number":43,"context_line":"        def wrapper(*args, **kw):"},{"line_number":44,"context_line":"            func_type \u003d inspect.getcallargs(func, *args, **kw)"},{"line_number":45,"context_line":"            if func_type.get(\"config\", {}).get(\"contexts\", {}).get(\"roles\") \\"},{"line_number":46,"context_line":"                    and func_type.get(\"context\", {}).get(\"admin\", {}.get("},{"line_number":47,"context_line":"                        \"credential\")):"},{"line_number":48,"context_line":"                func_type[\"context\"][\"config\"] \u003d func_type["},{"line_number":49,"context_line":"                    \"config\"][\"contexts\"]"},{"line_number":50,"context_line":"                rolegenerator \u003d roles.RoleGenerator(func_type[\"context\"])"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f93b717_d9c0e053","line":47,"range":{"start_line":45,"start_character":12,"end_line":47,"end_character":39},"in_reply_to":"7f96bb07_cea66810","updated":"2018-01-25 11:42:14.000000000","message":"key \"roles\" is in func_type[\"config\"][\"contexts\"] and key \"admin\" is in func_type[\"contexts\"] but I will simplify this : )","commit_id":"b5e3af3bdbfd541e55bccb151bc747ed3fb7ac8a"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"5fd09daf2daefe3c6e869aa7968d040d472a9bcb","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            context \u003d func_type.get(\"context\", {})"},{"line_number":47,"context_line":"            if config.get(\"contexts\", {}).get(\"roles\") \\"},{"line_number":48,"context_line":"                    and context.get(\"admin\", {}):"},{"line_number":49,"context_line":"                context[\"config\"] \u003d config[\"contexts\"]"},{"line_number":50,"context_line":"                rolegenerator \u003d roles.RoleGenerator(context)"},{"line_number":51,"context_line":"                with rolegenerator:"},{"line_number":52,"context_line":"                    rolegenerator.setup()"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f93b717_553570d9","line":49,"range":{"start_line":49,"start_character":17,"end_line":49,"end_character":54},"updated":"2018-01-25 14:14:06.000000000","message":"sorry, missed this in previous reviews.\n\nit would be nice to ensure that this decorator doesn\u0027t change anything for other validators.\nLet\u0027s make copy of context object to transmit to roles context","commit_id":"f06358d570fb86dbd6545ef17936a995d4d21c57"},{"author":{"_account_id":26025,"name":"chenxu","email":"xuchen1990xx@gmail.com","username":"chenxu"},"change_message_id":"6335506d78edbda1d0b0bc65c77a3560c59b9e46","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            context \u003d func_type.get(\"context\", {})"},{"line_number":47,"context_line":"            if config.get(\"contexts\", {}).get(\"roles\") \\"},{"line_number":48,"context_line":"                    and context.get(\"admin\", {}):"},{"line_number":49,"context_line":"                context[\"config\"] \u003d config[\"contexts\"]"},{"line_number":50,"context_line":"                rolegenerator \u003d roles.RoleGenerator(context)"},{"line_number":51,"context_line":"                with rolegenerator:"},{"line_number":52,"context_line":"                    rolegenerator.setup()"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f93b717_e91e130b","line":49,"range":{"start_line":49,"start_character":17,"end_line":49,"end_character":54},"in_reply_to":"5f93b717_553570d9","updated":"2018-01-26 02:55:50.000000000","message":"hi Andrey , I considered this question and have done a test with insepect. I am sure that changing context from inspect would not effect args. : )","commit_id":"f06358d570fb86dbd6545ef17936a995d4d21c57"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"8fd6042f8e3b7b971493681633bb6ddf6edd0ab1","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            context \u003d func_type.get(\"context\", {})"},{"line_number":47,"context_line":"            if config.get(\"contexts\", {}).get(\"roles\") \\"},{"line_number":48,"context_line":"                    and context.get(\"admin\", {}):"},{"line_number":49,"context_line":"                context[\"config\"] \u003d config[\"contexts\"]"},{"line_number":50,"context_line":"                rolegenerator \u003d roles.RoleGenerator(context)"},{"line_number":51,"context_line":"                with rolegenerator:"},{"line_number":52,"context_line":"                    rolegenerator.setup()"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f93b717_0abd35d7","line":49,"range":{"start_line":49,"start_character":17,"end_line":49,"end_character":54},"in_reply_to":"5f93b717_e91e130b","updated":"2018-01-29 13:44:45.000000000","message":"okey, sounds valid","commit_id":"f06358d570fb86dbd6545ef17936a995d4d21c57"}]}
