)]}'
{"magnum/api/validation.py":[{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"f0fcdac4d9cd1b58d7f8f733ec6bdf205c246e1a","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"def _enforce_network_driver_types(baymodel):"},{"line_number":65,"context_line":"    validator \u003d Validator.get_coe_validator(baymodel.coe)"},{"line_number":66,"context_line":"    validator.read_validator_config()"},{"line_number":67,"context_line":"    driver \u003d baymodel.network_driver"},{"line_number":68,"context_line":"    if driver:"},{"line_number":69,"context_line":"        validator.validate_network_driver(driver)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da85f559_26814c90","line":66,"updated":"2015-11-07 02:54:38.000000000","message":"hi, can we make this as a global variable ?\nwe really don\u0027t want to load validator every decorator was called.","commit_id":"ef49b8aa04d41b4df732aca4a3a5128f4780a51c"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"572f19cf37e67d9a3f7117ef7ea3542a2420b0d9","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"def _enforce_network_driver_types(baymodel):"},{"line_number":65,"context_line":"    validator \u003d Validator.get_coe_validator(baymodel.coe)"},{"line_number":66,"context_line":"    validator.read_validator_config()"},{"line_number":67,"context_line":"    driver \u003d baymodel.network_driver"},{"line_number":68,"context_line":"    if driver:"},{"line_number":69,"context_line":"        validator.validate_network_driver(driver)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da85f559_abbf9ba8","line":66,"in_reply_to":"da85f559_26814c90","updated":"2015-11-11 16:06:29.000000000","message":"Adding a global variable might add a slight improvement in performance, but we\u0027d sacrifice readability, IMO. The global variable would need to be a dictionary (with one class instance per COE), so the performance difference would be dictionary lookup vs. class instantiation (of a class that doesn\u0027t have any instance methods, not sure if that matters for performance). One thing to consider is that this validator gets called for baymodel creation, so it typically won\u0027t happen as frequently as, let\u0027s say, bay or container creation. I\u0027m trying to rig up some experiments to measure the time difference of these approaches, but I suspect the difference won\u0027t be worth the loss of readability.","commit_id":"ef49b8aa04d41b4df732aca4a3a5128f4780a51c"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"f96ae25714168d8643c4c4cfb98605f22d16a61b","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"def _enforce_network_driver_types(baymodel):"},{"line_number":65,"context_line":"    validator \u003d Validator.get_coe_validator(baymodel.coe)"},{"line_number":66,"context_line":"    validator.read_validator_config()"},{"line_number":67,"context_line":"    driver \u003d baymodel.network_driver"},{"line_number":68,"context_line":"    if driver:"},{"line_number":69,"context_line":"        validator.validate_network_driver(driver)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da85f559_9904644a","line":66,"in_reply_to":"da85f559_abbf9ba8","updated":"2015-11-11 20:57:22.000000000","message":"@Eli: Okay, I\u0027ll submit a new patch which does what you\u0027re suggesting. The new patch will add a \u0027validators\u0027 dictionary as a class variable so that the COE validators will only be instantiated once. It\u0027s more readable than I had thought. I did some experiments with timeit, and it\u0027s about 50% faster. Thanks for the suggestion!","commit_id":"ef49b8aa04d41b4df732aca4a3a5128f4780a51c"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"ab02deb3e4316346ae79e0bd5207799fd8dfffea","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    validator \u003d Validator.get_coe_validator(baymodel.coe)"},{"line_number":98,"context_line":"    if not baymodel.network_driver:"},{"line_number":99,"context_line":"        baymodel.network_driver \u003d validator.default_driver"},{"line_number":100,"context_line":"    driver \u003d baymodel.network_driver"},{"line_number":101,"context_line":"    validator.validate_network_driver(driver)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da85f559_ac6f96fa","line":100,"updated":"2015-11-12 03:32:36.000000000","message":"Should be able to eliminate the driver local var and consolidate this line and the line below.","commit_id":"067c327f9e0bc9304e61f62cdc97d12f47c7a9ee"}],"magnum/tests/unit/api/test_validation.py":[{"author":{"_account_id":10263,"name":"Vilobh Meshram","email":"vilobhmm@yahoo-inc.com","username":"vilobhmm"},"change_message_id":"90bb7d525adb7874bc8081983bd75cf92b270f8d","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        baymodel.network_driver \u003d network_driver_type"},{"line_number":123,"context_line":"        baymodel.coe \u003d coe"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        reload(v)"},{"line_number":126,"context_line":"        validator \u003d v.K8sValidator"},{"line_number":127,"context_line":"        validator.supported_drivers \u003d [\u0027flannel\u0027, \u0027type1\u0027, \u0027type2\u0027]"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da85f559_fb68c8f6","line":125,"updated":"2015-11-12 18:33:59.000000000","message":"Why we doing this ? Can you add some comments here ?","commit_id":"57a657f7d78a2a008fdac3c7011aca6327efc475"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"015dd78a899d12160fe3321d408db3791c9e3061","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        baymodel.network_driver \u003d network_driver_type"},{"line_number":123,"context_line":"        baymodel.coe \u003d coe"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        reload(v)"},{"line_number":126,"context_line":"        validator \u003d v.K8sValidator"},{"line_number":127,"context_line":"        validator.supported_drivers \u003d [\u0027flannel\u0027, \u0027type1\u0027, \u0027type2\u0027]"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da85f559_f1022809","line":125,"in_reply_to":"da85f559_fb68c8f6","updated":"2015-11-12 19:18:23.000000000","message":"In line #119, we override the configs, so we need to reload the python module to pick it up. Otherwise, it won\u0027t pick up the new configs and the tests will fail.","commit_id":"57a657f7d78a2a008fdac3c7011aca6327efc475"},{"author":{"_account_id":10263,"name":"Vilobh Meshram","email":"vilobhmm@yahoo-inc.com","username":"vilobhmm"},"change_message_id":"90bb7d525adb7874bc8081983bd75cf92b270f8d","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        baymodel.coe \u003d \u0027kubernetes\u0027"},{"line_number":210,"context_line":"        mock_baymodel_get_by_uuid.return_value \u003d baymodel"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        reload(v)"},{"line_number":213,"context_line":"        validator \u003d v.K8sValidator"},{"line_number":214,"context_line":"        validator.supported_drivers \u003d [\u0027flannel\u0027, \u0027type1\u0027, \u0027type2\u0027]"},{"line_number":215,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"da85f559_5b7a34be","line":212,"updated":"2015-11-12 18:33:59.000000000","message":"ditto.","commit_id":"57a657f7d78a2a008fdac3c7011aca6327efc475"}]}
