)]}'
{"quantum/api/v2/attributes.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":111,"context_line":"        if msg:"},{"line_number":112,"context_line":"            return msg"},{"line_number":113,"context_line":"        if ip in ips:"},{"line_number":114,"context_line":"            msg \u003d _(\"IP %s already defined\") % ip"},{"line_number":115,"context_line":"            LOG.debug(\"validate_nameservers: %s\", msg)"},{"line_number":116,"context_line":"            return msg"},{"line_number":117,"context_line":"        ips.add(ip)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FJiw%3D","line":114,"updated":"2012-10-11 04:41:45.000000000","message":"Thinking out loud.  Is a duplicate nameserver really a validation error?","commit_id":"f1325ca1410022c6db1fc6b32de06b8ff06f1aeb"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":111,"context_line":"        if msg:"},{"line_number":112,"context_line":"            return msg"},{"line_number":113,"context_line":"        if ip in ips:"},{"line_number":114,"context_line":"            msg \u003d _(\"IP %s already defined\") % ip"},{"line_number":115,"context_line":"            LOG.debug(\"validate_nameservers: %s\", msg)"},{"line_number":116,"context_line":"            return msg"},{"line_number":117,"context_line":"        ips.add(ip)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FJdY%3D","line":114,"updated":"2012-10-22 09:11:25.000000000","message":"You are correct. I have removed the code","commit_id":"f1325ca1410022c6db1fc6b32de06b8ff06f1aeb"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def _validate_string(data, valid_values\u003dNone):"},{"line_number":54,"context_line":"    try:"},{"line_number":55,"context_line":"        length \u003d len(data)"},{"line_number":56,"context_line":"    except Exception:"},{"line_number":57,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":58,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FHH0%3D","line":55,"updated":"2012-10-17 19:11:34.000000000","message":"This change only ensures that item supports __len__().\n\nConsider:\n\nif not isinstance(data, basestring):\n    msg \u003d _(\"Invalid input\")\n    LOG.debug(\"validate_string: %s\", msg)\n    return msg","commit_id":"5111025d62d60d839caff11c80e20f1eade6b81e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def _validate_string(data, valid_values\u003dNone):"},{"line_number":54,"context_line":"    try:"},{"line_number":55,"context_line":"        length \u003d len(data)"},{"line_number":56,"context_line":"    except Exception:"},{"line_number":57,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":58,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FHEs%3D","line":55,"in_reply_to":"AAAALH%2F%2FHH0%3D","updated":"2012-10-17 23:11:58.000000000","message":"Done","commit_id":"5111025d62d60d839caff11c80e20f1eade6b81e"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"def _validate_nameservers(data, valid_values\u003dNone):"},{"line_number":120,"context_line":"    if not data:"},{"line_number":121,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":122,"context_line":"        return msg"},{"line_number":123,"context_line":"    for ip in data:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FHHo%3D","line":120,"updated":"2012-10-17 19:11:34.000000000","message":"Should the user be able to pass the empty list?","commit_id":"5111025d62d60d839caff11c80e20f1eade6b81e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"def _validate_nameservers(data, valid_values\u003dNone):"},{"line_number":120,"context_line":"    if not data:"},{"line_number":121,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":122,"context_line":"        return msg"},{"line_number":123,"context_line":"    for ip in data:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FG5I%3D","line":120,"in_reply_to":"AAAALH%2F%2FHCE%3D","updated":"2012-10-18 14:02:28.000000000","message":"Done","commit_id":"5111025d62d60d839caff11c80e20f1eade6b81e"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"def _validate_nameservers(data, valid_values\u003dNone):"},{"line_number":120,"context_line":"    if not data:"},{"line_number":121,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":122,"context_line":"        return msg"},{"line_number":123,"context_line":"    for ip in data:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FHCE%3D","line":120,"in_reply_to":"AAAALH%2F%2FHEo%3D","updated":"2012-10-18 01:49:34.000000000","message":"json nulls become None, consider\n\nif data is None:","commit_id":"5111025d62d60d839caff11c80e20f1eade6b81e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"def _validate_nameservers(data, valid_values\u003dNone):"},{"line_number":120,"context_line":"    if not data:"},{"line_number":121,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":122,"context_line":"        return msg"},{"line_number":123,"context_line":"    for ip in data:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FHEo%3D","line":120,"in_reply_to":"AAAALH%2F%2FHHo%3D","updated":"2012-10-17 23:11:58.000000000","message":"The problem here is that when null is passed a 500 is returned instead of 400. [] is legitimate. I\u0027ll address this.","commit_id":"5111025d62d60d839caff11c80e20f1eade6b81e"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def _validate_hostroutes(data, valid_values\u003dNone):"},{"line_number":130,"context_line":"    if not data:"},{"line_number":131,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":132,"context_line":"        return msg"},{"line_number":133,"context_line":"    for host_route in data:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FHHw%3D","line":130,"updated":"2012-10-17 19:11:34.000000000","message":"Isn\u0027t [] a valid set of host routes?","commit_id":"5111025d62d60d839caff11c80e20f1eade6b81e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def _validate_hostroutes(data, valid_values\u003dNone):"},{"line_number":130,"context_line":"    if not data:"},{"line_number":131,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":132,"context_line":"        return msg"},{"line_number":133,"context_line":"    for host_route in data:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FHEk%3D","line":130,"in_reply_to":"AAAALH%2F%2FHHw%3D","updated":"2012-10-17 23:11:58.000000000","message":"Ditto.","commit_id":"5111025d62d60d839caff11c80e20f1eade6b81e"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"unresolved":false,"context_lines":[{"line_number":94,"context_line":"    \"\"\"Validate that start and end IP addresses are present"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    In addition to this the IP addresses will also be validated\"\"\""},{"line_number":97,"context_line":"    if data is None:"},{"line_number":98,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":99,"context_line":"        return msg"},{"line_number":100,"context_line":"    for ip_pool in data:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALn%2F%2F900%3D","line":97,"updated":"2012-10-24 14:26:58.000000000","message":"It is better to check if data is a list here to avoid exception in \u0027for\u0027 loop.\nIf isinstance() is used, None check is included.\n\nif not isinstance(data, list):","commit_id":"7a8040ff5df9b4c90c3b97f7b113edc7020dc012"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":94,"context_line":"    \"\"\"Validate that start and end IP addresses are present"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    In addition to this the IP addresses will also be validated\"\"\""},{"line_number":97,"context_line":"    if data is None:"},{"line_number":98,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":99,"context_line":"        return msg"},{"line_number":100,"context_line":"    for ip_pool in data:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALn%2F%2F9vs%3D","line":97,"in_reply_to":"AAAALn%2F%2F900%3D","updated":"2012-10-24 15:34:36.000000000","message":"Done","commit_id":"7a8040ff5df9b4c90c3b97f7b113edc7020dc012"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"def _validate_fixed_ips(data, valid_values\u003dNone):"},{"line_number":118,"context_line":"    if data is None:"},{"line_number":119,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":120,"context_line":"        return msg"},{"line_number":121,"context_line":"    fixed_ips \u003d []"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALn%2F%2F90w%3D","line":118,"updated":"2012-10-24 14:26:58.000000000","message":"Ditto.","commit_id":"7a8040ff5df9b4c90c3b97f7b113edc7020dc012"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"def _validate_fixed_ips(data, valid_values\u003dNone):"},{"line_number":118,"context_line":"    if data is None:"},{"line_number":119,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":120,"context_line":"        return msg"},{"line_number":121,"context_line":"    fixed_ips \u003d []"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALn%2F%2F9vo%3D","line":118,"in_reply_to":"AAAALn%2F%2F90w%3D","updated":"2012-10-24 15:34:36.000000000","message":"Done","commit_id":"7a8040ff5df9b4c90c3b97f7b113edc7020dc012"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"unresolved":false,"context_lines":[{"line_number":138,"context_line":""},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"def _validate_nameservers(data, valid_values\u003dNone):"},{"line_number":141,"context_line":"    if data is None:"},{"line_number":142,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":143,"context_line":"        return msg"},{"line_number":144,"context_line":"    ips \u003d set()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALn%2F%2F90s%3D","line":141,"updated":"2012-10-24 14:26:58.000000000","message":"Ditto.","commit_id":"7a8040ff5df9b4c90c3b97f7b113edc7020dc012"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":138,"context_line":""},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"def _validate_nameservers(data, valid_values\u003dNone):"},{"line_number":141,"context_line":"    if data is None:"},{"line_number":142,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":143,"context_line":"        return msg"},{"line_number":144,"context_line":"    ips \u003d set()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALn%2F%2F9vk%3D","line":141,"in_reply_to":"AAAALn%2F%2F90s%3D","updated":"2012-10-24 15:34:36.000000000","message":"Done","commit_id":"7a8040ff5df9b4c90c3b97f7b113edc7020dc012"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"unresolved":false,"context_lines":[{"line_number":154,"context_line":""},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"def _validate_hostroutes(data, valid_values\u003dNone):"},{"line_number":157,"context_line":"    if data is None:"},{"line_number":158,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":159,"context_line":"        return msg"},{"line_number":160,"context_line":"    hostroutes \u003d []"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALn%2F%2F90o%3D","line":157,"updated":"2012-10-24 14:26:58.000000000","message":"Ditto.","commit_id":"7a8040ff5df9b4c90c3b97f7b113edc7020dc012"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":154,"context_line":""},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"def _validate_hostroutes(data, valid_values\u003dNone):"},{"line_number":157,"context_line":"    if data is None:"},{"line_number":158,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":159,"context_line":"        return msg"},{"line_number":160,"context_line":"    hostroutes \u003d []"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAALn%2F%2F9vg%3D","line":157,"in_reply_to":"AAAALn%2F%2F90o%3D","updated":"2012-10-24 15:34:36.000000000","message":"Done","commit_id":"7a8040ff5df9b4c90c3b97f7b113edc7020dc012"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":94,"context_line":"    \"\"\"Validate that start and end IP addresses are present"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    In addition to this the IP addresses will also be validated\"\"\""},{"line_number":97,"context_line":"    if not isinstance(data, list):"},{"line_number":98,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":99,"context_line":"        return msg"},{"line_number":100,"context_line":"    for ip_pool in data:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALn%2F%2F9eM%3D","line":97,"updated":"2012-10-24 18:43:56.000000000","message":"Input of [[\u0027start\u0027, \u0027end\u0027]] will throw exceptions and not return an error message. What if we should change the code slightly and wrap the for loop in try/except. The for loop can then work using the assumption that the data structure is valid. If the structure is invalid a key or access exception will be raised. Otherwise we\u0027ll need more checks and informative messages that state that data should be a list and a second check to indicate that each fixed IP is a dict with specific keys.","commit_id":"9ee3072be584aab52b5f43e93cea105245e19dd3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":94,"context_line":"    \"\"\"Validate that start and end IP addresses are present"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    In addition to this the IP addresses will also be validated\"\"\""},{"line_number":97,"context_line":"    if not isinstance(data, list):"},{"line_number":98,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":99,"context_line":"        return msg"},{"line_number":100,"context_line":"    for ip_pool in data:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALn%2F%2F9Xw%3D","line":97,"in_reply_to":"AAAALn%2F%2F9eM%3D","updated":"2012-10-24 19:44:05.000000000","message":"Done","commit_id":"9ee3072be584aab52b5f43e93cea105245e19dd3"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":120,"context_line":"        return msg"},{"line_number":121,"context_line":"    fixed_ips \u003d []"},{"line_number":122,"context_line":"    for fixed_ip in data:"},{"line_number":123,"context_line":"        if \u0027ip_address\u0027 in fixed_ip:"},{"line_number":124,"context_line":"            msg \u003d _validate_ip_address(fixed_ip[\u0027ip_address\u0027])"},{"line_number":125,"context_line":"            if msg:"},{"line_number":126,"context_line":"                return msg"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALn%2F%2F9ek%3D","line":123,"updated":"2012-10-24 18:43:56.000000000","message":"Input of [[\u0027ip_address\u0027, \u0027subnet_id\u0027]] will throw exceptions and not return an error message.  What if we should change the code slightly and wrap the for loop in try/except.  The for loop can then work using the assumption that the data structure is valid.  If the structure is invalid a key or access exception will be raised.  Otherwise we\u0027ll need more checks and informative messages that state that data should be a list and a second check to indicate that each fixed IP is a dict with specific keys.","commit_id":"9ee3072be584aab52b5f43e93cea105245e19dd3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":120,"context_line":"        return msg"},{"line_number":121,"context_line":"    fixed_ips \u003d []"},{"line_number":122,"context_line":"    for fixed_ip in data:"},{"line_number":123,"context_line":"        if \u0027ip_address\u0027 in fixed_ip:"},{"line_number":124,"context_line":"            msg \u003d _validate_ip_address(fixed_ip[\u0027ip_address\u0027])"},{"line_number":125,"context_line":"            if msg:"},{"line_number":126,"context_line":"                return msg"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALn%2F%2F9Xs%3D","line":123,"in_reply_to":"AAAALn%2F%2F9ek%3D","updated":"2012-10-24 19:44:05.000000000","message":"Done","commit_id":"9ee3072be584aab52b5f43e93cea105245e19dd3"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":154,"context_line":""},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"def _validate_hostroutes(data, valid_values\u003dNone):"},{"line_number":157,"context_line":"    if not isinstance(data, list):"},{"line_number":158,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":159,"context_line":"        return msg"},{"line_number":160,"context_line":"    hostroutes \u003d []"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALn%2F%2F9d8%3D","line":157,"updated":"2012-10-24 18:43:56.000000000","message":"Same as above.","commit_id":"9ee3072be584aab52b5f43e93cea105245e19dd3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":154,"context_line":""},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"def _validate_hostroutes(data, valid_values\u003dNone):"},{"line_number":157,"context_line":"    if not isinstance(data, list):"},{"line_number":158,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":159,"context_line":"        return msg"},{"line_number":160,"context_line":"    hostroutes \u003d []"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALn%2F%2F9XM%3D","line":157,"in_reply_to":"AAAALn%2F%2F9d8%3D","updated":"2012-10-24 19:44:05.000000000","message":"Done","commit_id":"9ee3072be584aab52b5f43e93cea105245e19dd3"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":200,"context_line":"def _validate_regex(data, valid_values\u003dNone):"},{"line_number":201,"context_line":"    try:"},{"line_number":202,"context_line":"        match \u003d re.match(valid_values, data)"},{"line_number":203,"context_line":"    except Exception:"},{"line_number":204,"context_line":"        msg \u003d _(\"%s is not valid input\") % data"},{"line_number":205,"context_line":"        raise q_exc.InvalidInput(error_message\u003dmsg)"},{"line_number":206,"context_line":"    if match:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALn%2F%2F9dE%3D","line":203,"updated":"2012-10-24 18:43:56.000000000","message":"This should be TypeError.  Since regular expression syntax errors are not related to input and raise sre_constants.error.","commit_id":"9ee3072be584aab52b5f43e93cea105245e19dd3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":200,"context_line":"def _validate_regex(data, valid_values\u003dNone):"},{"line_number":201,"context_line":"    try:"},{"line_number":202,"context_line":"        match \u003d re.match(valid_values, data)"},{"line_number":203,"context_line":"    except Exception:"},{"line_number":204,"context_line":"        msg \u003d _(\"%s is not valid input\") % data"},{"line_number":205,"context_line":"        raise q_exc.InvalidInput(error_message\u003dmsg)"},{"line_number":206,"context_line":"    if match:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALn%2F%2F9XE%3D","line":203,"in_reply_to":"AAAALn%2F%2F9dE%3D","updated":"2012-10-24 19:44:05.000000000","message":"Done","commit_id":"9ee3072be584aab52b5f43e93cea105245e19dd3"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":202,"context_line":"        match \u003d re.match(valid_values, data)"},{"line_number":203,"context_line":"    except Exception:"},{"line_number":204,"context_line":"        msg \u003d _(\"%s is not valid input\") % data"},{"line_number":205,"context_line":"        raise q_exc.InvalidInput(error_message\u003dmsg)"},{"line_number":206,"context_line":"    if match:"},{"line_number":207,"context_line":"        return"},{"line_number":208,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALn%2F%2F9cs%3D","line":205,"updated":"2012-10-24 18:43:56.000000000","message":"Why does this validator raise an exception?  The others all return msgs on failure.","commit_id":"9ee3072be584aab52b5f43e93cea105245e19dd3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":202,"context_line":"        match \u003d re.match(valid_values, data)"},{"line_number":203,"context_line":"    except Exception:"},{"line_number":204,"context_line":"        msg \u003d _(\"%s is not valid input\") % data"},{"line_number":205,"context_line":"        raise q_exc.InvalidInput(error_message\u003dmsg)"},{"line_number":206,"context_line":"    if match:"},{"line_number":207,"context_line":"        return"},{"line_number":208,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALn%2F%2F9XA%3D","line":205,"in_reply_to":"AAAALn%2F%2F9cs%3D","updated":"2012-10-24 19:44:05.000000000","message":"My bad","commit_id":"9ee3072be584aab52b5f43e93cea105245e19dd3"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":200,"context_line":""},{"line_number":201,"context_line":"def _validate_regex(data, valid_values\u003dNone):"},{"line_number":202,"context_line":"    try:"},{"line_number":203,"context_line":"        match \u003d re.match(valid_values, data)"},{"line_number":204,"context_line":"    except TypeError:"},{"line_number":205,"context_line":"        msg \u003d _(\"%s is not valid input\") % data"},{"line_number":206,"context_line":"        LOG.debug(\"validate_regex: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALn%2F%2F73Y%3D","line":203,"updated":"2012-10-26 03:54:44.000000000","message":"Consider:\nif re.match(valid_values, data):\n    return\n\nYou can then remove 208-213","commit_id":"fc32008f01ad72747b2b664d6132a1b2e53301ed"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":200,"context_line":""},{"line_number":201,"context_line":"def _validate_regex(data, valid_values\u003dNone):"},{"line_number":202,"context_line":"    try:"},{"line_number":203,"context_line":"        match \u003d re.match(valid_values, data)"},{"line_number":204,"context_line":"    except TypeError:"},{"line_number":205,"context_line":"        msg \u003d _(\"%s is not valid input\") % data"},{"line_number":206,"context_line":"        LOG.debug(\"validate_regex: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALn%2F%2F7x4%3D","line":203,"in_reply_to":"AAAALn%2F%2F73Y%3D","updated":"2012-10-26 07:32:43.000000000","message":"Not sure why I did not do this from the start. Thanks!","commit_id":"fc32008f01ad72747b2b664d6132a1b2e53301ed"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"39b0dbd3ef60d166e98382d098f0d8cb5261d0c3","unresolved":false,"context_lines":[{"line_number":382,"context_line":"                         \u0027default\u0027: \u0027\u0027,"},{"line_number":383,"context_line":"                         \u0027is_visible\u0027: True},"},{"line_number":384,"context_line":"        \u0027tenant_id\u0027: {\u0027allow_post\u0027: True, \u0027allow_put\u0027: False,"},{"line_number":385,"context_line":"                      \u0027validate\u0027: {\u0027type:string\u0027: None},"},{"line_number":386,"context_line":"                      \u0027required_by_policy\u0027: True,"},{"line_number":387,"context_line":"                      \u0027is_visible\u0027: True},"},{"line_number":388,"context_line":"        \u0027status\u0027: {\u0027allow_post\u0027: False, \u0027allow_put\u0027: False,"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALn%2F%2F71s%3D","line":385,"updated":"2012-10-26 05:04:33.000000000","message":"Should we add \u0027validate\u0027: {\u0027type:string\u0027: None}\u0027 for subnets and networks?","commit_id":"fc32008f01ad72747b2b664d6132a1b2e53301ed"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":382,"context_line":"                         \u0027default\u0027: \u0027\u0027,"},{"line_number":383,"context_line":"                         \u0027is_visible\u0027: True},"},{"line_number":384,"context_line":"        \u0027tenant_id\u0027: {\u0027allow_post\u0027: True, \u0027allow_put\u0027: False,"},{"line_number":385,"context_line":"                      \u0027validate\u0027: {\u0027type:string\u0027: None},"},{"line_number":386,"context_line":"                      \u0027required_by_policy\u0027: True,"},{"line_number":387,"context_line":"                      \u0027is_visible\u0027: True},"},{"line_number":388,"context_line":"        \u0027status\u0027: {\u0027allow_post\u0027: False, \u0027allow_put\u0027: False,"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALn%2F%2F7x0%3D","line":385,"in_reply_to":"AAAALn%2F%2F71s%3D","updated":"2012-10-26 07:32:43.000000000","message":"Done\nGood call ;). Not sure why I missed these.","commit_id":"fc32008f01ad72747b2b664d6132a1b2e53301ed"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"39b0dbd3ef60d166e98382d098f0d8cb5261d0c3","unresolved":false,"context_lines":[{"line_number":129,"context_line":"            # Ensure that duplicate IPs are not set"},{"line_number":130,"context_line":"            if (\u0027ip_address\u0027 in fixed_ip and"},{"line_number":131,"context_line":"                \u0027subnet_id\u0027 in fixed_ip):"},{"line_number":132,"context_line":"                if  fixed_ip in fixed_ips:"},{"line_number":133,"context_line":"                    msg \u003d _(\"Duplicate IP\u0027s %s\") % fixed_ip"},{"line_number":134,"context_line":"                    return msg"},{"line_number":135,"context_line":"                fixed_ips.append(fixed_ip)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F5Y4%3D","line":132,"updated":"2012-10-30 03:14:27.000000000","message":"multiple spaces after keyword, I don\u0027t why jenkin didn\u0027t warning this","commit_id":"5dd6cf3209991e64a4be96f5fcb5ba10e1419469"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":129,"context_line":"            # Ensure that duplicate IPs are not set"},{"line_number":130,"context_line":"            if (\u0027ip_address\u0027 in fixed_ip and"},{"line_number":131,"context_line":"                \u0027subnet_id\u0027 in fixed_ip):"},{"line_number":132,"context_line":"                if  fixed_ip in fixed_ips:"},{"line_number":133,"context_line":"                    msg \u003d _(\"Duplicate IP\u0027s %s\") % fixed_ip"},{"line_number":134,"context_line":"                    return msg"},{"line_number":135,"context_line":"                fixed_ips.append(fixed_ip)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F5R0%3D","line":132,"in_reply_to":"AAAALn%2F%2F5Y4%3D","updated":"2012-10-30 08:01:01.000000000","message":"Done","commit_id":"5dd6cf3209991e64a4be96f5fcb5ba10e1419469"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def _validate_string(data, valid_values\u003dNone):"},{"line_number":54,"context_line":"    if not isinstance(data, basestring):"},{"line_number":55,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":56,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"},{"line_number":57,"context_line":"        return msg"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F224%3D","line":55,"updated":"2012-11-01 03:14:55.000000000","message":"seems like msg should be more specific, like \"%s is not a valid string\", to be parallel with boolean example above.  Comment also applies to other uses of \"Invalid input\" below.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def _validate_string(data, valid_values\u003dNone):"},{"line_number":54,"context_line":"    if not isinstance(data, basestring):"},{"line_number":55,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":56,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"},{"line_number":57,"context_line":"        return msg"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F2j4%3D","line":55,"in_reply_to":"AAAALn%2F%2F224%3D","updated":"2012-11-01 13:28:17.000000000","message":"Done","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"unresolved":false,"context_lines":[{"line_number":55,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":56,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"},{"line_number":57,"context_line":"        return msg"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"def _validate_range(data, valid_values\u003dNone):"},{"line_number":61,"context_line":"    min_value \u003d valid_values[0]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F4Xo%3D","line":58,"updated":"2012-10-30 22:23:16.000000000","message":"We should also check length of string. If it is not specified, it should be no longer than 255","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":55,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":56,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"},{"line_number":57,"context_line":"        return msg"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"def _validate_range(data, valid_values\u003dNone):"},{"line_number":61,"context_line":"    min_value \u003d valid_values[0]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F2pI%3D","line":58,"in_reply_to":"AAAALn%2F%2F220%3D","updated":"2012-11-01 13:28:17.000000000","message":"Yes, this is the bug that I was thinking of.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":55,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":56,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"},{"line_number":57,"context_line":"        return msg"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"def _validate_range(data, valid_values\u003dNone):"},{"line_number":61,"context_line":"    min_value \u003d valid_values[0]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F220%3D","line":58,"in_reply_to":"AAAALn%2F%2F3J8%3D","updated":"2012-11-01 03:14:55.000000000","message":"seems reasonable.  \n\nis this bug sufficient? https://bugs.launchpad.net/quantum/+bug/1044129","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"unresolved":false,"context_lines":[{"line_number":55,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":56,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"},{"line_number":57,"context_line":"        return msg"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"def _validate_range(data, valid_values\u003dNone):"},{"line_number":61,"context_line":"    min_value \u003d valid_values[0]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F3J8%3D","line":58,"in_reply_to":"AAAALn%2F%2F3Zw%3D","updated":"2012-10-31 20:21:52.000000000","message":"I got it. I agree too.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":55,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":56,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"},{"line_number":57,"context_line":"        return msg"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"def _validate_range(data, valid_values\u003dNone):"},{"line_number":61,"context_line":"    min_value \u003d valid_values[0]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F3Zw%3D","line":58,"in_reply_to":"AAAALn%2F%2F3bk%3D","updated":"2012-10-31 17:29:10.000000000","message":"i agree with mark. i\u0027ll file a bug which will help us track this.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":55,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":56,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"},{"line_number":57,"context_line":"        return msg"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"def _validate_range(data, valid_values\u003dNone):"},{"line_number":61,"context_line":"    min_value \u003d valid_values[0]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F3bk%3D","line":58,"in_reply_to":"AAAALn%2F%2F4Xo%3D","updated":"2012-10-31 17:13:40.000000000","message":"I agree that we should do length checking since backend DBs handle it differently, but I think that should be in a separate patch that focuses on that one issue as it will touch multiple parts of the code.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":98,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":99,"context_line":"        return msg"},{"line_number":100,"context_line":"    try:"},{"line_number":101,"context_line":"        for ip_pool in data:"},{"line_number":102,"context_line":"            msg \u003d _validate_ip_address(ip_pool[\u0027start\u0027])"},{"line_number":103,"context_line":"            if msg:"},{"line_number":104,"context_line":"                return msg"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F22o%3D","line":101,"updated":"2012-11-01 03:14:55.000000000","message":"potentially check if ip_pool is a dictionary? and if keys exist in dict?  This could let us provide more helpful error messages.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":98,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":99,"context_line":"        return msg"},{"line_number":100,"context_line":"    try:"},{"line_number":101,"context_line":"        for ip_pool in data:"},{"line_number":102,"context_line":"            msg \u003d _validate_ip_address(ip_pool[\u0027start\u0027])"},{"line_number":103,"context_line":"            if msg:"},{"line_number":104,"context_line":"                return msg"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F1k8%3D","line":101,"in_reply_to":"AAAALn%2F%2F1zA%3D","updated":"2012-11-02 08:35:00.000000000","message":"The [\"foo\"] will fail on the validate address. This has a better fix in patch set 16.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":98,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":99,"context_line":"        return msg"},{"line_number":100,"context_line":"    try:"},{"line_number":101,"context_line":"        for ip_pool in data:"},{"line_number":102,"context_line":"            msg \u003d _validate_ip_address(ip_pool[\u0027start\u0027])"},{"line_number":103,"context_line":"            if msg:"},{"line_number":104,"context_line":"                return msg"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F2iw%3D","line":101,"in_reply_to":"AAAALn%2F%2F22o%3D","updated":"2012-11-01 13:28:17.000000000","message":"Checking if not isinstance(ip_pool, dict) did not help. Maybe I missed something here.\nI added specific key tests.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":98,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":99,"context_line":"        return msg"},{"line_number":100,"context_line":"    try:"},{"line_number":101,"context_line":"        for ip_pool in data:"},{"line_number":102,"context_line":"            msg \u003d _validate_ip_address(ip_pool[\u0027start\u0027])"},{"line_number":103,"context_line":"            if msg:"},{"line_number":104,"context_line":"                return msg"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F1zA%3D","line":101,"in_reply_to":"AAAALn%2F%2F2iw%3D","updated":"2012-11-01 22:44:47.000000000","message":"huh... so if you pass in pools that look like: [ \"foo\" ] rather than [ { \u0027start\u0027: \u002710.0.0.2\u0027, \u0027end\u0027: \u002710.0.0.100\u0027} ] the result is the same?","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":132,"context_line":"                if fixed_ip in fixed_ips:"},{"line_number":133,"context_line":"                    msg \u003d _(\"Duplicate IP\u0027s %s\") % fixed_ip"},{"line_number":134,"context_line":"                    return msg"},{"line_number":135,"context_line":"                fixed_ips.append(fixed_ip)"},{"line_number":136,"context_line":"    except Exception:"},{"line_number":137,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":138,"context_line":"        LOG.debug(\"validate_fixed_ips: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F22c%3D","line":135,"updated":"2012-11-01 03:14:55.000000000","message":"Would this unintentionally accept the case where the fixed_ip dict is empty?  I\u0027d have to ask salvatore, but I don\u0027t think that\u0027s allowed in spec. \n\nAlso, if ip_address is specified, I think subnet_id must be specified, right?","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":132,"context_line":"                if fixed_ip in fixed_ips:"},{"line_number":133,"context_line":"                    msg \u003d _(\"Duplicate IP\u0027s %s\") % fixed_ip"},{"line_number":134,"context_line":"                    return msg"},{"line_number":135,"context_line":"                fixed_ips.append(fixed_ip)"},{"line_number":136,"context_line":"    except Exception:"},{"line_number":137,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":138,"context_line":"        LOG.debug(\"validate_fixed_ips: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F2ik%3D","line":135,"in_reply_to":"AAAALn%2F%2F22c%3D","updated":"2012-11-01 13:28:17.000000000","message":"Fixed IP\u0027s can be []. This is the case when the user wants to delete assigned IP\u0027s. This is a legal value.\nRegarding the second point - you are correct. I have added a check - basically at the stage we can only check that the subnet is defined.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":132,"context_line":"                if fixed_ip in fixed_ips:"},{"line_number":133,"context_line":"                    msg \u003d _(\"Duplicate IP\u0027s %s\") % fixed_ip"},{"line_number":134,"context_line":"                    return msg"},{"line_number":135,"context_line":"                fixed_ips.append(fixed_ip)"},{"line_number":136,"context_line":"    except Exception:"},{"line_number":137,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":138,"context_line":"        LOG.debug(\"validate_fixed_ips: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F2f8%3D","line":135,"in_reply_to":"AAAALn%2F%2F2ik%3D","updated":"2012-11-02 08:35:00.000000000","message":"I go back on what I wrote here. The IP allocation code enables the user to pass the ip address. This is checked against configured subnets on the network.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":132,"context_line":"                if fixed_ip in fixed_ips:"},{"line_number":133,"context_line":"                    msg \u003d _(\"Duplicate IP\u0027s %s\") % fixed_ip"},{"line_number":134,"context_line":"                    return msg"},{"line_number":135,"context_line":"                fixed_ips.append(fixed_ip)"},{"line_number":136,"context_line":"    except Exception:"},{"line_number":137,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":138,"context_line":"        LOG.debug(\"validate_fixed_ips: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F1zM%3D","line":135,"in_reply_to":"AAAALn%2F%2F2ik%3D","updated":"2012-11-01 22:44:47.000000000","message":"i think we\u0027re talking about two different things.  the array can be empty, i agree.  I was talking about the dict that is an entry in the array.  I don\u0027t think that is allowed.  for example: \n\nfixed_ips \u003d [ {} ]","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":133,"context_line":"                    msg \u003d _(\"Duplicate IP\u0027s %s\") % fixed_ip"},{"line_number":134,"context_line":"                    return msg"},{"line_number":135,"context_line":"                fixed_ips.append(fixed_ip)"},{"line_number":136,"context_line":"    except Exception:"},{"line_number":137,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":138,"context_line":"        LOG.debug(\"validate_fixed_ips: %s\", msg)"},{"line_number":139,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F210%3D","line":136,"updated":"2012-11-01 03:14:55.000000000","message":"Nit: I think the spec would technicall allow having the same fixed IP allocated from different subnets, but this code would prevent it.   Tough to think of a use case though.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":133,"context_line":"                    msg \u003d _(\"Duplicate IP\u0027s %s\") % fixed_ip"},{"line_number":134,"context_line":"                    return msg"},{"line_number":135,"context_line":"                fixed_ips.append(fixed_ip)"},{"line_number":136,"context_line":"    except Exception:"},{"line_number":137,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":138,"context_line":"        LOG.debug(\"validate_fixed_ips: %s\", msg)"},{"line_number":139,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F1kw%3D","line":136,"in_reply_to":"AAAALn%2F%2F1zE%3D","updated":"2012-11-02 08:35:00.000000000","message":"I think that the allocation pool code prevent subnets with overlapping ip\u0027s be defined on a network. The above example that you have will fail when the IP is checked to be part of the subnet. \nIf you want I could add the check for the duplicate IP\u0027s here.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":133,"context_line":"                    msg \u003d _(\"Duplicate IP\u0027s %s\") % fixed_ip"},{"line_number":134,"context_line":"                    return msg"},{"line_number":135,"context_line":"                fixed_ips.append(fixed_ip)"},{"line_number":136,"context_line":"    except Exception:"},{"line_number":137,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":138,"context_line":"        LOG.debug(\"validate_fixed_ips: %s\", msg)"},{"line_number":139,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F2iU%3D","line":136,"in_reply_to":"AAAALn%2F%2F210%3D","updated":"2012-11-01 13:28:17.000000000","message":"I think that the code checks this - we do not allow overlapping subnets. When a ip is to be allocated from a subnet we check that the IP is part of the subnet. \nI think that we should be ok for this.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":133,"context_line":"                    msg \u003d _(\"Duplicate IP\u0027s %s\") % fixed_ip"},{"line_number":134,"context_line":"                    return msg"},{"line_number":135,"context_line":"                fixed_ips.append(fixed_ip)"},{"line_number":136,"context_line":"    except Exception:"},{"line_number":137,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":138,"context_line":"        LOG.debug(\"validate_fixed_ips: %s\", msg)"},{"line_number":139,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F1zE%3D","line":136,"in_reply_to":"AAAALn%2F%2F2iU%3D","updated":"2012-11-01 22:44:47.000000000","message":"do you mean the above code, or code that is elsewhere (e.g., in the plugin).  \n\nI think we may be taling past each other again.  I\u0027m actually talking about the following example: \n\nfixed_ips \u003d [ {\"ip_address\": \"10.0.0.2\", \"subnet_id\" : X}, \n                      {\"ip_address\": \"10.0.0.2\", \"subnet_id\" : Y}]\n\nwhere both subnets have the IP 10.0.0.2 available for allocation.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":144,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":145,"context_line":"        return msg"},{"line_number":146,"context_line":"    ips \u003d set()"},{"line_number":147,"context_line":"    for ip in data:"},{"line_number":148,"context_line":"        msg \u003d _validate_ip_address(ip)"},{"line_number":149,"context_line":"        if msg:"},{"line_number":150,"context_line":"            return msg"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F200%3D","line":147,"updated":"2012-11-01 03:14:55.000000000","message":"the spec actually doesn\u0027t require this to be an IP... it actually just says a list of strings: http://docs.openstack.org/api/openstack-network/2.0/content/Concepts-d1e369.html#subnet\n\nit could well be a DNS name, an even a non-qualified name.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":144,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":145,"context_line":"        return msg"},{"line_number":146,"context_line":"    ips \u003d set()"},{"line_number":147,"context_line":"    for ip in data:"},{"line_number":148,"context_line":"        msg \u003d _validate_ip_address(ip)"},{"line_number":149,"context_line":"        if msg:"},{"line_number":150,"context_line":"            return msg"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F1ks%3D","line":147,"in_reply_to":"AAAALn%2F%2F1y4%3D","updated":"2012-11-02 08:35:00.000000000","message":"ok.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":144,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":145,"context_line":"        return msg"},{"line_number":146,"context_line":"    ips \u003d set()"},{"line_number":147,"context_line":"    for ip in data:"},{"line_number":148,"context_line":"        msg \u003d _validate_ip_address(ip)"},{"line_number":149,"context_line":"        if msg:"},{"line_number":150,"context_line":"            return msg"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F2iQ%3D","line":147,"in_reply_to":"AAAALn%2F%2F200%3D","updated":"2012-11-01 13:28:17.000000000","message":"This is a tricky one. :)","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":144,"context_line":"        msg \u003d _(\"Invalid input\")"},{"line_number":145,"context_line":"        return msg"},{"line_number":146,"context_line":"    ips \u003d set()"},{"line_number":147,"context_line":"    for ip in data:"},{"line_number":148,"context_line":"        msg \u003d _validate_ip_address(ip)"},{"line_number":149,"context_line":"        if msg:"},{"line_number":150,"context_line":"            return msg"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAALn%2F%2F1y4%3D","line":147,"in_reply_to":"AAAALn%2F%2F2iQ%3D","updated":"2012-11-01 22:44:47.000000000","message":"yeah, whatever we end up enforcing here should probably also be added to the API spec.","commit_id":"beb63c185d0ccd7a37ce9d23bca9f933f8e075cc"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":121,"context_line":"            msg \u003d _validate_ip_address(ip_pool[\u0027end\u0027])"},{"line_number":122,"context_line":"            if msg:"},{"line_number":123,"context_line":"                LOG.debug(\"validate_ip_pools: %s\", msg)"},{"line_number":124,"context_line":"                return msg"},{"line_number":125,"context_line":"    except Exception:"},{"line_number":126,"context_line":"        msg \u003d _(\"\u0027%s\u0027 in not a valid IP pool\") % data"},{"line_number":127,"context_line":"        LOG.debug(\"validate_ip_pools: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAALn%2F%2F2Wg%3D","line":124,"updated":"2012-11-01 15:23:15.000000000","message":"If we want more detailed messages:\n\nexcept KeyError, e:\n    args \u003d {\u0027key_name\u0027: e.message, \u0027ip_pool\u0027: ip_pool}\n    msg \u003d _(\"Invalid input. Required key: \u0027%(key_name)s\u0027 missing from %(ip_pool).\" % args)\n    LOG.debug(\"validate_ip_pools: %s\", msg)\n    return msg\nexcept TypeError, e:\n    msg \u003d _(\"Invalid input.  Pool %s must be a dictionary\" % ip_pool)\n    LOG.debug(\"validate_ip_pools: %s, msg)\n    return msg","commit_id":"cf3f622ba139f8c65e2f22d834ada5b7472b1c4c"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":121,"context_line":"            msg \u003d _validate_ip_address(ip_pool[\u0027end\u0027])"},{"line_number":122,"context_line":"            if msg:"},{"line_number":123,"context_line":"                LOG.debug(\"validate_ip_pools: %s\", msg)"},{"line_number":124,"context_line":"                return msg"},{"line_number":125,"context_line":"    except Exception:"},{"line_number":126,"context_line":"        msg \u003d _(\"\u0027%s\u0027 in not a valid IP pool\") % data"},{"line_number":127,"context_line":"        LOG.debug(\"validate_ip_pools: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAALn%2F%2F2FI%3D","line":124,"in_reply_to":"AAAALn%2F%2F2Wg%3D","updated":"2012-11-01 20:10:55.000000000","message":"Done","commit_id":"cf3f622ba139f8c65e2f22d834ada5b7472b1c4c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":297,"context_line":"        kvp_map[key].add(value)"},{"line_number":298,"context_line":"    return dict((x, list(y)) for x, y in kvp_map.iteritems())"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"HOSTNAME_PATTERN \u003d \"[a-z\\d+].*?\\\\.\\w{2,4}$\""},{"line_number":301,"context_line":""},{"line_number":302,"context_line":"HEX_ELEM \u003d \u0027[0-9A-Fa-f]\u0027"},{"line_number":303,"context_line":"UUID_PATTERN \u003d \u0027-\u0027.join([HEX_ELEM + \u0027{8}\u0027, HEX_ELEM + \u0027{4}\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAALn%2F%2F2Vo%3D","line":300,"updated":"2012-11-01 15:23:15.000000000","message":"I don\u0027t think this pattern is correct.  It would requires a FQDN where relative names should be allowed.  If we decide to restrict to a FQDN, don\u0027t forget there are longer TLDs: .travel, .museum.","commit_id":"cf3f622ba139f8c65e2f22d834ada5b7472b1c4c"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":297,"context_line":"        kvp_map[key].add(value)"},{"line_number":298,"context_line":"    return dict((x, list(y)) for x, y in kvp_map.iteritems())"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"HOSTNAME_PATTERN \u003d \"[a-z\\d+].*?\\\\.\\w{2,4}$\""},{"line_number":301,"context_line":""},{"line_number":302,"context_line":"HEX_ELEM \u003d \u0027[0-9A-Fa-f]\u0027"},{"line_number":303,"context_line":"UUID_PATTERN \u003d \u0027-\u0027.join([HEX_ELEM + \u0027{8}\u0027, HEX_ELEM + \u0027{4}\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAALn%2F%2F2EM%3D","line":300,"in_reply_to":"AAAALn%2F%2F2Vo%3D","updated":"2012-11-01 20:10:55.000000000","message":"Done","commit_id":"cf3f622ba139f8c65e2f22d834ada5b7472b1c4c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":49,"context_line":"        return msg"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"def _validate_string(data, valid_values\u003dNone):"},{"line_number":53,"context_line":"    if not isinstance(data, basestring):"},{"line_number":54,"context_line":"        msg \u003d _(\"\u0027%s\u0027 is not a valid string\") % data"},{"line_number":55,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1Yk%3D","line":52,"updated":"2012-11-02 15:29:35.000000000","message":"As we do not use keyword param names when calling validators, we can probably rename valid_values to something more meaningful, such as max_len.\n\n(this is a minor comment)","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":49,"context_line":"        return msg"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"def _validate_string(data, valid_values\u003dNone):"},{"line_number":53,"context_line":"    if not isinstance(data, basestring):"},{"line_number":54,"context_line":"        msg \u003d _(\"\u0027%s\u0027 is not a valid string\") % data"},{"line_number":55,"context_line":"        LOG.debug(\"validate_string: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1TY%3D","line":52,"in_reply_to":"AAAALn%2F%2F1Yk%3D","updated":"2012-11-02 16:27:40.000000000","message":"Done","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":112,"context_line":"            msg \u003d _validate_ip_address(ip_pool[\u0027end\u0027])"},{"line_number":113,"context_line":"            if msg:"},{"line_number":114,"context_line":"                LOG.debug(\"validate_ip_pools: %s\", msg)"},{"line_number":115,"context_line":"                return msg"},{"line_number":116,"context_line":"    except KeyError, e:"},{"line_number":117,"context_line":"        args \u003d {\u0027key_name\u0027: e.message, \u0027ip_pool\u0027: ip_pool}"},{"line_number":118,"context_line":"        msg \u003d _(\"Invalid input. Required key: \u0027%(key_name)s\u0027 \""}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1YA%3D","line":115,"updated":"2012-11-02 15:29:35.000000000","message":"Can we somehow avoid code duplication?\nAlso, it might be worth checking that only the valid keys are supplied, so the following:\n\nip_pool: {\u0027start\u0027: 10.0.0.1, \u0027end\u0027: 10.0.0.200, \u0027puzz\u0027: 10.0.0.4} will return an error\n\nFor instance:\nkeys \u003d ip_pool.keys()[:]\nfor key in ip_pool.keys():\n     if key in (\u0027start\u0027, \u0027end\u0027):\n        msg \u003d _validate_ip_address(ip_pool[key])\n        if msg:\n            LOG.debug(\u0027blah blah:%s\", msg)\n            return msg\n        keys.remove(key)\n     else:\n            msg \u003d \"I don\u0027t know you:%s\", key\n            return msg\nif len(keys):\n   msg \u003d \"Some keys were missing:%s\", keys\n   return msg","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":112,"context_line":"            msg \u003d _validate_ip_address(ip_pool[\u0027end\u0027])"},{"line_number":113,"context_line":"            if msg:"},{"line_number":114,"context_line":"                LOG.debug(\"validate_ip_pools: %s\", msg)"},{"line_number":115,"context_line":"                return msg"},{"line_number":116,"context_line":"    except KeyError, e:"},{"line_number":117,"context_line":"        args \u003d {\u0027key_name\u0027: e.message, \u0027ip_pool\u0027: ip_pool}"},{"line_number":118,"context_line":"        msg \u003d _(\"Invalid input. Required key: \u0027%(key_name)s\u0027 \""}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1Rk%3D","line":115,"in_reply_to":"AAAALn%2F%2F1YA%3D","updated":"2012-11-02 16:27:40.000000000","message":"Done","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":123,"context_line":"        msg \u003d _(\"Invalid input. Pool %s must be a dictionary.\") % ip_pool"},{"line_number":124,"context_line":"        LOG.debug(\"validate_ip_pools: %s\", msg)"},{"line_number":125,"context_line":"        return msg"},{"line_number":126,"context_line":"    except Exception:"},{"line_number":127,"context_line":"        msg \u003d _(\"\u0027%s\u0027 in not a valid IP pool\") % data"},{"line_number":128,"context_line":"        LOG.debug(\"validate_ip_pools: %s\", msg)"},{"line_number":129,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1X8%3D","line":126,"updated":"2012-11-02 15:29:35.000000000","message":"is this just a catch-all? If we expect to end up here just in abnormal conditions unrelated to input validation, we should consider re-raising for not cancelling the exception.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":123,"context_line":"        msg \u003d _(\"Invalid input. Pool %s must be a dictionary.\") % ip_pool"},{"line_number":124,"context_line":"        LOG.debug(\"validate_ip_pools: %s\", msg)"},{"line_number":125,"context_line":"        return msg"},{"line_number":126,"context_line":"    except Exception:"},{"line_number":127,"context_line":"        msg \u003d _(\"\u0027%s\u0027 in not a valid IP pool\") % data"},{"line_number":128,"context_line":"        LOG.debug(\"validate_ip_pools: %s\", msg)"},{"line_number":129,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1Rg%3D","line":126,"in_reply_to":"AAAALn%2F%2F1X8%3D","updated":"2012-11-02 16:27:40.000000000","message":"Updated following the suggestions above.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":148,"context_line":"                    LOG.debug(\"validate_fixed_ips: %s\", msg)"},{"line_number":149,"context_line":"                    return msg"},{"line_number":150,"context_line":"            # Ensure that duplicate entries are not set - just checking IP"},{"line_number":151,"context_line":"            # suffices. Duplicate subnet_id\u0027s are legitimate."},{"line_number":152,"context_line":"            if \u0027ip_address\u0027 in fixed_ip:"},{"line_number":153,"context_line":"                if fixed_ip[\u0027ip_address\u0027] in ips:"},{"line_number":154,"context_line":"                    msg \u003d _(\"Duplicate entry %s\") % fixed_ip"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1X0%3D","line":151,"updated":"2012-11-02 15:29:35.000000000","message":"I might be missing something here. Why do we want to allow a port to have multiple addresses on the same subnet?","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":148,"context_line":"                    LOG.debug(\"validate_fixed_ips: %s\", msg)"},{"line_number":149,"context_line":"                    return msg"},{"line_number":150,"context_line":"            # Ensure that duplicate entries are not set - just checking IP"},{"line_number":151,"context_line":"            # suffices. Duplicate subnet_id\u0027s are legitimate."},{"line_number":152,"context_line":"            if \u0027ip_address\u0027 in fixed_ip:"},{"line_number":153,"context_line":"                if fixed_ip[\u0027ip_address\u0027] in ips:"},{"line_number":154,"context_line":"                    msg \u003d _(\"Duplicate entry %s\") % fixed_ip"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1RY%3D","line":151,"in_reply_to":"AAAALn%2F%2F1X0%3D","updated":"2012-11-02 16:27:40.000000000","message":"I actually have been asked in the past by a number of people if they are able to allocate more than one IP address on a port. They specifically would like those addresses to be on the same subnet. So as unlikely as it sounds I guess that there may be some users who wish to do this.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"def _validate_nameservers(data, valid_values\u003dNone):"},{"line_number":165,"context_line":"    if not isinstance(data, list):"},{"line_number":166,"context_line":"        msg \u003d _(\"\u0027%s\u0027 in not a valid nameserver\") % data"},{"line_number":167,"context_line":"        LOG.debug(\"validate_nameservers: %s\", msg)"},{"line_number":168,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1Xo%3D","line":165,"updated":"2012-11-02 15:29:35.000000000","message":"Instead of checking for a list, consider checking for iterable. We might internally change the implementation of the api, and for instance data might become a set, or a tuple.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"def _validate_nameservers(data, valid_values\u003dNone):"},{"line_number":165,"context_line":"    if not isinstance(data, list):"},{"line_number":166,"context_line":"        msg \u003d _(\"\u0027%s\u0027 in not a valid nameserver\") % data"},{"line_number":167,"context_line":"        LOG.debug(\"validate_nameservers: %s\", msg)"},{"line_number":168,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1No%3D","line":165,"in_reply_to":"AAAALn%2F%2F1PI%3D","updated":"2012-11-02 17:16:56.000000000","message":"Done","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"def _validate_nameservers(data, valid_values\u003dNone):"},{"line_number":165,"context_line":"    if not isinstance(data, list):"},{"line_number":166,"context_line":"        msg \u003d _(\"\u0027%s\u0027 in not a valid nameserver\") % data"},{"line_number":167,"context_line":"        LOG.debug(\"validate_nameservers: %s\", msg)"},{"line_number":168,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1PI%3D","line":165,"in_reply_to":"AAAALn%2F%2F1RU%3D","updated":"2012-11-02 17:03:08.000000000","message":"I meant  hasattr(data,\u0027__iter__\u0027)\nIs this what you tried? The above returns False for strings, even if you can iterate over them, which is quite comfy","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"def _validate_nameservers(data, valid_values\u003dNone):"},{"line_number":165,"context_line":"    if not isinstance(data, list):"},{"line_number":166,"context_line":"        msg \u003d _(\"\u0027%s\u0027 in not a valid nameserver\") % data"},{"line_number":167,"context_line":"        LOG.debug(\"validate_nameservers: %s\", msg)"},{"line_number":168,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1RU%3D","line":165,"in_reply_to":"AAAALn%2F%2F1Xo%3D","updated":"2012-11-02 16:27:40.000000000","message":"On of the problems that we have is that we need to check that this is not None as input. \nWhen I try what you suggested I get:\nTypeError: \u0027NoneType\u0027 object is not iterable","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":171,"context_line":"        msg \u003d _validate_ip_address(ip)"},{"line_number":172,"context_line":"        if msg:"},{"line_number":173,"context_line":"            # This may be a hostname"},{"line_number":174,"context_line":"            msg \u003d _validate_regex(ip, HOSTNAME_PATTERN)"},{"line_number":175,"context_line":"            if msg:"},{"line_number":176,"context_line":"                msg \u003d _(\"\u0027%s\u0027 in not a valid nameserver\") % ip"},{"line_number":177,"context_line":"                LOG.debug(\"validate_nameservers: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1XQ%3D","line":174,"updated":"2012-11-02 15:29:35.000000000","message":"We assume here that such names are already resolvable. Nothing against that, but we need to document that ensuring those names are resolvable it\u0027s up to the tenant.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":171,"context_line":"        msg \u003d _validate_ip_address(ip)"},{"line_number":172,"context_line":"        if msg:"},{"line_number":173,"context_line":"            # This may be a hostname"},{"line_number":174,"context_line":"            msg \u003d _validate_regex(ip, HOSTNAME_PATTERN)"},{"line_number":175,"context_line":"            if msg:"},{"line_number":176,"context_line":"                msg \u003d _(\"\u0027%s\u0027 in not a valid nameserver\") % ip"},{"line_number":177,"context_line":"                LOG.debug(\"validate_nameservers: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1RM%3D","line":174,"in_reply_to":"AAAALn%2F%2F1XQ%3D","updated":"2012-11-02 16:27:40.000000000","message":"OK. I have opened a documentation bug for this.\nhttps://bugs.launchpad.net/quantum/+bug/1074406","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":179,"context_line":"        if ip in ips:"},{"line_number":180,"context_line":"            msg \u003d _(\"Duplicate nameserver %s\") % ip"},{"line_number":181,"context_line":"            LOG.debug(\"validate_nameservers: %s\", msg)"},{"line_number":182,"context_line":"            return msg"},{"line_number":183,"context_line":"        ips.add(ip)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1Xk%3D","line":182,"updated":"2012-11-02 15:29:35.000000000","message":"I\u0027ve seen this code in another method. Consider refactoring.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":179,"context_line":"        if ip in ips:"},{"line_number":180,"context_line":"            msg \u003d _(\"Duplicate nameserver %s\") % ip"},{"line_number":181,"context_line":"            LOG.debug(\"validate_nameservers: %s\", msg)"},{"line_number":182,"context_line":"            return msg"},{"line_number":183,"context_line":"        ips.add(ip)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1RI%3D","line":182,"in_reply_to":"AAAALn%2F%2F1Xk%3D","updated":"2012-11-02 16:27:40.000000000","message":"I would prefer to leave this as is as the messages differ.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":366,"context_line":"        \u0027status\u0027: {\u0027allow_post\u0027: False, \u0027allow_put\u0027: False,"},{"line_number":367,"context_line":"                   \u0027is_visible\u0027: True},"},{"line_number":368,"context_line":"        \u0027tenant_id\u0027: {\u0027allow_post\u0027: True, \u0027allow_put\u0027: False,"},{"line_number":369,"context_line":"                      \u0027validate\u0027: {\u0027type:string\u0027: None},"},{"line_number":370,"context_line":"                      \u0027required_by_policy\u0027: True,"},{"line_number":371,"context_line":"                      \u0027is_visible\u0027: True},"},{"line_number":372,"context_line":"        SHARED: {\u0027allow_post\u0027: True,"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1XI%3D","line":369,"updated":"2012-11-02 15:29:35.000000000","message":"We might want to use a function for validating keystone-like ids rather than just a string check (which I do not think will do much)","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":366,"context_line":"        \u0027status\u0027: {\u0027allow_post\u0027: False, \u0027allow_put\u0027: False,"},{"line_number":367,"context_line":"                   \u0027is_visible\u0027: True},"},{"line_number":368,"context_line":"        \u0027tenant_id\u0027: {\u0027allow_post\u0027: True, \u0027allow_put\u0027: False,"},{"line_number":369,"context_line":"                      \u0027validate\u0027: {\u0027type:string\u0027: None},"},{"line_number":370,"context_line":"                      \u0027required_by_policy\u0027: True,"},{"line_number":371,"context_line":"                      \u0027is_visible\u0027: True},"},{"line_number":372,"context_line":"        SHARED: {\u0027allow_post\u0027: True,"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1Q0%3D","line":369,"in_reply_to":"AAAALn%2F%2F1XI%3D","updated":"2012-11-02 16:27:40.000000000","message":"At the moment the string check is3just to ensure that the value is not Null. This is a tough one as there may be people using Quantum that do not use Keystone. The tenant-id cab be any string in that case.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":95,"context_line":"        return msg"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"def _validate_ip_pools(data, valid_values\u003dNone):"},{"line_number":99,"context_line":"    \"\"\"Validate that start and end IP addresses are present"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    In addition to this the IP addresses will also be validated\"\"\""}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAALn%2F%2FzTE%3D","line":98,"updated":"2012-11-05 20:11:19.000000000","message":"I would prefer that you revert to the Patchset #17 implementation of this function.  Consider this version:\n\ndef _validate_ip_pools(data, valid_values\u003dNone):\n    \"\"\"Validate that start and end IP addresses are present\n\n    In addition to this the IP addresses will also be validated\"\"\"\n    if not isinstance(data, list):\n        msg \u003d _(\"\u0027%s\u0027 in not a valid IP pool\") % data\n        LOG.debug(\"validate_ip_pools: %s\", msg)\n        return msg\n\n    expected_keys \u003d set(\u0027start\u0027, \u0027end\u0027)\n    try:\n        for ip_pool in data:\n            if set(ip_pool.keys()) !\u003d expected_keys:\n                msg \u003d _(\"Expected keys not found. Expected: %s Provided: %s\")\n                LOG.debug(msg % (expected_keys, ip_pool.keys()))\n                return msg\n            for k in expected_keys:\n                msg \u003d _validate_ip_address(k)\n                if msg:\n                    LOG.debug(\"validate_ip_pools: %s\", msg)\n                    return msg\n    except KeyError, e:\n        args \u003d {\u0027key_name\u0027: e.message, \u0027ip_pool\u0027: ip_pool}\n        msg \u003d _(\"Invalid input. Required key: \u0027%(key_name)s\u0027 \"\n                \"missing from %(ip_pool)s.\") % args\n        LOG.debug(\"validate_ip_pools: %s\", msg)\n        return msg\n    except TypeError, e:\n        msg \u003d _(\"Invalid input. Pool %s must be a dictionary.\") % ip_pool\n        LOG.debug(\"validate_ip_pools: %s\", msg)\n        return msg\n    except Exception:\n        msg \u003d _(\"\u0027%s\u0027 in not a valid IP pool\") % data\n        LOG.debug(\"validate_ip_pools: %s\", msg)\n        return msg","commit_id":"b971df34dd6d7edb6db3291166552f1d92bf13ac"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":95,"context_line":"        return msg"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"def _validate_ip_pools(data, valid_values\u003dNone):"},{"line_number":99,"context_line":"    \"\"\"Validate that start and end IP addresses are present"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    In addition to this the IP addresses will also be validated\"\"\""}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAALn%2F%2FyvY%3D","line":98,"in_reply_to":"AAAALn%2F%2FzTE%3D","updated":"2012-11-06 07:27:38.000000000","message":"Done","commit_id":"b971df34dd6d7edb6db3291166552f1d92bf13ac"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    In addition to this the IP addresses will also be validated\"\"\""},{"line_number":104,"context_line":"    if not isinstance(data, list):"},{"line_number":105,"context_line":"        msg \u003d _(\"\u0027%s\u0027 in not a valid IP pool\") % data"},{"line_number":106,"context_line":"        LOG.debug(\"validate_ip_pools: %s\", msg)"},{"line_number":107,"context_line":"        return msg"},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAALn%2F%2FxD8%3D","line":105,"updated":"2012-11-07 18:07:43.000000000","message":"msg is a little odd, as what failed is a check of a list, not an individual IP pool.  Similar with messages below.  I can clean this up in a later patch.","commit_id":"5dbb4046637462bdcb04acc8f4cbebf8db480f35"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    In addition to this the IP addresses will also be validated\"\"\""},{"line_number":104,"context_line":"    if not isinstance(data, list):"},{"line_number":105,"context_line":"        msg \u003d _(\"\u0027%s\u0027 in not a valid IP pool\") % data"},{"line_number":106,"context_line":"        LOG.debug(\"validate_ip_pools: %s\", msg)"},{"line_number":107,"context_line":"        return msg"},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAALn%2F%2FxB8%3D","line":105,"in_reply_to":"AAAALn%2F%2FxD8%3D","updated":"2012-11-07 18:16:04.000000000","message":"I can make the changes if you want","commit_id":"5dbb4046637462bdcb04acc8f4cbebf8db480f35"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":168,"context_line":""},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"def _validate_nameservers(data, valid_values\u003dNone):"},{"line_number":171,"context_line":"    if not hasattr(data, \u0027__iter__\u0027):"},{"line_number":172,"context_line":"        msg \u003d _(\"\u0027%s\u0027 in not a valid nameserver\") % data"},{"line_number":173,"context_line":"        LOG.debug(\"validate_nameservers: %s\", msg)"},{"line_number":174,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAALn%2F%2FxEE%3D","line":171,"updated":"2012-11-07 18:07:43.000000000","message":"why is this check different from isinstance(data, list)?  Are nameservers any different than hostroutes, ip pools, etc?  Not a big deal, just curious if I\u0027m missing something.","commit_id":"5dbb4046637462bdcb04acc8f4cbebf8db480f35"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":168,"context_line":""},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"def _validate_nameservers(data, valid_values\u003dNone):"},{"line_number":171,"context_line":"    if not hasattr(data, \u0027__iter__\u0027):"},{"line_number":172,"context_line":"        msg \u003d _(\"\u0027%s\u0027 in not a valid nameserver\") % data"},{"line_number":173,"context_line":"        LOG.debug(\"validate_nameservers: %s\", msg)"},{"line_number":174,"context_line":"        return msg"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAALn%2F%2FxCA%3D","line":171,"in_reply_to":"AAAALn%2F%2FxEE%3D","updated":"2012-11-07 18:16:04.000000000","message":"This is following one of Slavtores comments \"Instead of checking for a list, consider checking for iterable. We might internally change the implementation of the api, and for instance data might become a set, or a tuple.\"","commit_id":"5dbb4046637462bdcb04acc8f4cbebf8db480f35"}],"quantum/api/v2/base.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":46,"context_line":"             exceptions.DNSNameServersExhausted: webob.exc.HTTPBadRequest,"},{"line_number":47,"context_line":"             # Some plugins enforce policies as well"},{"line_number":48,"context_line":"             exceptions.PolicyNotAuthorized: webob.exc.HTTPForbidden,"},{"line_number":49,"context_line":"             netaddr.AddrFormatError: webob.exc.HTTPBadRequest,"},{"line_number":50,"context_line":"             AttributeError: webob.exc.HTTPBadRequest,"},{"line_number":51,"context_line":"             ValueError: webob.exc.HTTPBadRequest,"},{"line_number":52,"context_line":"             }"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1W4%3D","line":49,"updated":"2012-11-02 15:29:35.000000000","message":"So far we\u0027ve been mapping quantum exception to HTTP exceptions, now we\u0027re adding an exception from netaddr and two builtins. Generally this is fine, but we\u0027ll end up generating BadRequest errors for all the cases when this exception is raised. So what would normally be a 500 will result in a 400.\nThis is not necessarily bad. The alternative would be defining more quantum exceptions for these input validation errors.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":46,"context_line":"             exceptions.DNSNameServersExhausted: webob.exc.HTTPBadRequest,"},{"line_number":47,"context_line":"             # Some plugins enforce policies as well"},{"line_number":48,"context_line":"             exceptions.PolicyNotAuthorized: webob.exc.HTTPForbidden,"},{"line_number":49,"context_line":"             netaddr.AddrFormatError: webob.exc.HTTPBadRequest,"},{"line_number":50,"context_line":"             AttributeError: webob.exc.HTTPBadRequest,"},{"line_number":51,"context_line":"             ValueError: webob.exc.HTTPBadRequest,"},{"line_number":52,"context_line":"             }"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1PA%3D","line":49,"in_reply_to":"AAAALn%2F%2F1Qs%3D","updated":"2012-11-02 17:03:08.000000000","message":"sounds good to me","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":46,"context_line":"             exceptions.DNSNameServersExhausted: webob.exc.HTTPBadRequest,"},{"line_number":47,"context_line":"             # Some plugins enforce policies as well"},{"line_number":48,"context_line":"             exceptions.PolicyNotAuthorized: webob.exc.HTTPForbidden,"},{"line_number":49,"context_line":"             netaddr.AddrFormatError: webob.exc.HTTPBadRequest,"},{"line_number":50,"context_line":"             AttributeError: webob.exc.HTTPBadRequest,"},{"line_number":51,"context_line":"             ValueError: webob.exc.HTTPBadRequest,"},{"line_number":52,"context_line":"             }"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1PE%3D","line":49,"in_reply_to":"AAAALn%2F%2F1Qs%3D","updated":"2012-11-02 17:03:08.000000000","message":"sounds good to me","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":46,"context_line":"             exceptions.DNSNameServersExhausted: webob.exc.HTTPBadRequest,"},{"line_number":47,"context_line":"             # Some plugins enforce policies as well"},{"line_number":48,"context_line":"             exceptions.PolicyNotAuthorized: webob.exc.HTTPForbidden,"},{"line_number":49,"context_line":"             netaddr.AddrFormatError: webob.exc.HTTPBadRequest,"},{"line_number":50,"context_line":"             AttributeError: webob.exc.HTTPBadRequest,"},{"line_number":51,"context_line":"             ValueError: webob.exc.HTTPBadRequest,"},{"line_number":52,"context_line":"             }"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1Qs%3D","line":49,"in_reply_to":"AAAALn%2F%2F1W4%3D","updated":"2012-11-02 16:27:40.000000000","message":"Agreed. I would prefer to do this in a separate patch. If you agree I\u0027ll open a bug for tracking.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":48,"context_line":"             exceptions.PolicyNotAuthorized: webob.exc.HTTPForbidden,"},{"line_number":49,"context_line":"             netaddr.AddrFormatError: webob.exc.HTTPBadRequest,"},{"line_number":50,"context_line":"             AttributeError: webob.exc.HTTPBadRequest,"},{"line_number":51,"context_line":"             ValueError: webob.exc.HTTPBadRequest,"},{"line_number":52,"context_line":"             }"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"QUOTAS \u003d quota.QUOTAS"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAALn%2F%2FxDI%3D","line":51,"updated":"2012-11-07 18:07:43.000000000","message":"I\u0027m not a big fan of this, as realistically generic errors like AttributeError or ValueError could be raised due to an internal server error that has nothing to do with bad user input (i.e., should raise a 500, not a 400).  I\u0027d rather see these exceptions caught locally and","commit_id":"5dbb4046637462bdcb04acc8f4cbebf8db480f35"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":48,"context_line":"             exceptions.PolicyNotAuthorized: webob.exc.HTTPForbidden,"},{"line_number":49,"context_line":"             netaddr.AddrFormatError: webob.exc.HTTPBadRequest,"},{"line_number":50,"context_line":"             AttributeError: webob.exc.HTTPBadRequest,"},{"line_number":51,"context_line":"             ValueError: webob.exc.HTTPBadRequest,"},{"line_number":52,"context_line":"             }"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"QUOTAS \u003d quota.QUOTAS"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAALn%2F%2FxBw%3D","line":51,"in_reply_to":"AAAALn%2F%2FxDI%3D","updated":"2012-11-07 18:16:04.000000000","message":"If I recall correctly, and may be mistaken, as the patch has drawn on for quite a while, this is treating cases of updates when the key is null.","commit_id":"5dbb4046637462bdcb04acc8f4cbebf8db480f35"}],"quantum/api/v2/resource.py":[{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"88f441da3505158c98a741daad5bb4620f3e9f54","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            raise webob.exc.HTTPInternalServerError(**kwargs)"},{"line_number":106,"context_line":"        except webob.exc.HTTPException as e:"},{"line_number":107,"context_line":"            LOG.exception(\u0027%s failed\u0027 % action)"},{"line_number":108,"context_line":"            e.body \u003d serializer({\u0027QuantumError\u0027: str(e)})"},{"line_number":109,"context_line":"            e.content_type \u003d content_type"},{"line_number":110,"context_line":"            raise"},{"line_number":111,"context_line":"        except Exception as e:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FJkQ%3D","line":108,"updated":"2012-10-11 03:54:47.000000000","message":"Hi, I found the raise statement in \u0027HTTPException as e\u0027 section  cheats us:\n        except webob.exc.HTTPException as e:\n\n            LOG.exception(\u0027%s failed\u0027 % action)\n\n            e.body \u003d serializer({\u0027QuantumError\u0027: str(e)})\n\n            e.content_type \u003d content_type\n\n            raise -\u003e raise e\n\nafter that:\nquantum -v subnet-create mynet2 1223.12.12.0/24\nwill return 400 instead of 500:\nHTTPBadRequest: Invalid input for cidr. Reason: 1223.12.12.0/24 is not a valid IP subnet.\n2012-10-11 11:52:51    DEBUG [eventlet.wsgi.server] 192.168.1.100 - - [11/Oct/2012 11:52:51] \"POST /v2.0/subnets.json HTTP/1.1\" 400 225 3.135316","commit_id":"f1325ca1410022c6db1fc6b32de06b8ff06f1aeb"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":96,"context_line":"            result \u003d method(request\u003drequest, **args)"},{"line_number":97,"context_line":"        except (ValueError, AttributeError,"},{"line_number":98,"context_line":"                exceptions.QuantumException,"},{"line_number":99,"context_line":"                netaddr.AddrFormatError) as e:"},{"line_number":100,"context_line":"            LOG.exception(\u0027%s failed\u0027 % action)"},{"line_number":101,"context_line":"            body \u003d serializer({\u0027QuantumError\u0027: str(e)})"},{"line_number":102,"context_line":"            kwargs \u003d {\u0027body\u0027: body, \u0027content_type\u0027: content_type}"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1Ws%3D","line":99,"updated":"2012-11-02 15:29:35.000000000","message":"with reference to the comment in base.py - the suggested change will allow you to catch for QuantumException only","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":96,"context_line":"            result \u003d method(request\u003drequest, **args)"},{"line_number":97,"context_line":"        except (ValueError, AttributeError,"},{"line_number":98,"context_line":"                exceptions.QuantumException,"},{"line_number":99,"context_line":"                netaddr.AddrFormatError) as e:"},{"line_number":100,"context_line":"            LOG.exception(\u0027%s failed\u0027 % action)"},{"line_number":101,"context_line":"            body \u003d serializer({\u0027QuantumError\u0027: str(e)})"},{"line_number":102,"context_line":"            kwargs \u003d {\u0027body\u0027: body, \u0027content_type\u0027: content_type}"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1O8%3D","line":99,"in_reply_to":"AAAALn%2F%2F1Qo%3D","updated":"2012-11-02 17:03:08.000000000","message":"sounds good to me","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":96,"context_line":"            result \u003d method(request\u003drequest, **args)"},{"line_number":97,"context_line":"        except (ValueError, AttributeError,"},{"line_number":98,"context_line":"                exceptions.QuantumException,"},{"line_number":99,"context_line":"                netaddr.AddrFormatError) as e:"},{"line_number":100,"context_line":"            LOG.exception(\u0027%s failed\u0027 % action)"},{"line_number":101,"context_line":"            body \u003d serializer({\u0027QuantumError\u0027: str(e)})"},{"line_number":102,"context_line":"            kwargs \u003d {\u0027body\u0027: body, \u0027content_type\u0027: content_type}"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1Qo%3D","line":99,"in_reply_to":"AAAALn%2F%2F1Ws%3D","updated":"2012-11-02 16:27:40.000000000","message":"Agreed - hopefully we can have a bug to deal with this.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"}],"quantum/db/db_base_plugin_v2.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":955,"context_line":"            s[\u0027gateway_ip\u0027] !\u003d attributes.ATTR_NOT_SPECIFIED):"},{"line_number":956,"context_line":"            self._validate_ip_version(ip_ver, s[\u0027gateway_ip\u0027], \u0027gateway_ip\u0027)"},{"line_number":957,"context_line":""},{"line_number":958,"context_line":"        if (\u0027dns_nameservers\u0027 in s and"},{"line_number":959,"context_line":"            s[\u0027dns_nameservers\u0027] !\u003d attributes.ATTR_NOT_SPECIFIED):"},{"line_number":960,"context_line":"            if len(s[\u0027dns_nameservers\u0027]) \u003e cfg.CONF.max_dns_nameservers:"},{"line_number":961,"context_line":"                raise q_exc.DNSNameServersExhausted("}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FJiU%3D","line":958,"updated":"2012-10-11 04:41:45.000000000","message":"I wondering if we should just make bool(ATTR_NOT_SPECIFIED) \u003d\u003d False.  I think it might make the code easier to read.  Then you could write:\n\nif s.get(\u0027dns_nameservers\u0027):","commit_id":"f1325ca1410022c6db1fc6b32de06b8ff06f1aeb"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":955,"context_line":"            s[\u0027gateway_ip\u0027] !\u003d attributes.ATTR_NOT_SPECIFIED):"},{"line_number":956,"context_line":"            self._validate_ip_version(ip_ver, s[\u0027gateway_ip\u0027], \u0027gateway_ip\u0027)"},{"line_number":957,"context_line":""},{"line_number":958,"context_line":"        if (\u0027dns_nameservers\u0027 in s and"},{"line_number":959,"context_line":"            s[\u0027dns_nameservers\u0027] !\u003d attributes.ATTR_NOT_SPECIFIED):"},{"line_number":960,"context_line":"            if len(s[\u0027dns_nameservers\u0027]) \u003e cfg.CONF.max_dns_nameservers:"},{"line_number":961,"context_line":"                raise q_exc.DNSNameServersExhausted("}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FJdQ%3D","line":958,"updated":"2012-10-22 09:11:25.000000000","message":"I would prefer to do this in a different patch","commit_id":"f1325ca1410022c6db1fc6b32de06b8ff06f1aeb"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":956,"context_line":"            self._validate_ip_version(ip_ver, s[\u0027gateway_ip\u0027], \u0027gateway_ip\u0027)"},{"line_number":957,"context_line":""},{"line_number":958,"context_line":"        if (\u0027dns_nameservers\u0027 in s and"},{"line_number":959,"context_line":"            s[\u0027dns_nameservers\u0027] !\u003d attributes.ATTR_NOT_SPECIFIED):"},{"line_number":960,"context_line":"            if len(s[\u0027dns_nameservers\u0027]) \u003e cfg.CONF.max_dns_nameservers:"},{"line_number":961,"context_line":"                raise q_exc.DNSNameServersExhausted("},{"line_number":962,"context_line":"                    subnet_id\u003did,"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1Wk%3D","line":959,"updated":"2012-11-02 15:29:35.000000000","message":"These changes are unrelated, but I\u0027m fine with them.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":956,"context_line":"            self._validate_ip_version(ip_ver, s[\u0027gateway_ip\u0027], \u0027gateway_ip\u0027)"},{"line_number":957,"context_line":""},{"line_number":958,"context_line":"        if (\u0027dns_nameservers\u0027 in s and"},{"line_number":959,"context_line":"            s[\u0027dns_nameservers\u0027] !\u003d attributes.ATTR_NOT_SPECIFIED):"},{"line_number":960,"context_line":"            if len(s[\u0027dns_nameservers\u0027]) \u003e cfg.CONF.max_dns_nameservers:"},{"line_number":961,"context_line":"                raise q_exc.DNSNameServersExhausted("},{"line_number":962,"context_line":"                    subnet_id\u003did,"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1Qk%3D","line":959,"in_reply_to":"AAAALn%2F%2F1Wk%3D","updated":"2012-11-02 16:27:40.000000000","message":":)\nIn one of the patch sets I did change code related hence the change here.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"}],"quantum/tests/unit/test_attributes.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"39b0dbd3ef60d166e98382d098f0d8cb5261d0c3","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                 None]"},{"line_number":40,"context_line":"        for pool in pools:"},{"line_number":41,"context_line":"            msg \u003d attributes._validate_ip_pools(pool, None)"},{"line_number":42,"context_line":"            self.assertEquals(1, len(msg) !\u003d 0)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def test_fixed_ips(self):"},{"line_number":45,"context_line":"        fixed_ips \u003d [[{\u0027subnet_id\u0027: \u002700000000-ffff-ffff-ffff-000000000000\u0027,"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F5WU%3D","line":42,"updated":"2012-10-30 03:14:27.000000000","message":"Should we add valid value test?","commit_id":"5dd6cf3209991e64a4be96f5fcb5ba10e1419469"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":39,"context_line":"                 None]"},{"line_number":40,"context_line":"        for pool in pools:"},{"line_number":41,"context_line":"            msg \u003d attributes._validate_ip_pools(pool, None)"},{"line_number":42,"context_line":"            self.assertEquals(1, len(msg) !\u003d 0)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def test_fixed_ips(self):"},{"line_number":45,"context_line":"        fixed_ips \u003d [[{\u0027subnet_id\u0027: \u002700000000-ffff-ffff-ffff-000000000000\u0027,"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F5Rw%3D","line":42,"in_reply_to":"AAAALn%2F%2F5V0%3D","updated":"2012-10-30 08:01:01.000000000","message":"Done","commit_id":"5dd6cf3209991e64a4be96f5fcb5ba10e1419469"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":39,"context_line":"                 None]"},{"line_number":40,"context_line":"        for pool in pools:"},{"line_number":41,"context_line":"            msg \u003d attributes._validate_ip_pools(pool, None)"},{"line_number":42,"context_line":"            self.assertEquals(1, len(msg) !\u003d 0)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def test_fixed_ips(self):"},{"line_number":45,"context_line":"        fixed_ips \u003d [[{\u0027subnet_id\u0027: \u002700000000-ffff-ffff-ffff-000000000000\u0027,"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F5V0%3D","line":42,"in_reply_to":"AAAALn%2F%2F5WU%3D","updated":"2012-10-30 03:19:16.000000000","message":"Actually, this should be changed to:\n\nself.assertIsNotNone(msg)","commit_id":"5dd6cf3209991e64a4be96f5fcb5ba10e1419469"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":52,"context_line":"                       \u0027ip_address\u0027: \u00271.1.1.1\u0027}]]"},{"line_number":53,"context_line":"        for fixed in fixed_ips:"},{"line_number":54,"context_line":"            msg \u003d attributes._validate_fixed_ips(fixed, None)"},{"line_number":55,"context_line":"            self.assertEquals(1, len(msg) !\u003d 0)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def test_nameservers(self):"},{"line_number":58,"context_line":"        ns_pools \u003d [[\u00271100.0.0.2\u0027],"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F5Vs%3D","line":55,"updated":"2012-10-30 03:19:16.000000000","message":"ditto","commit_id":"5dd6cf3209991e64a4be96f5fcb5ba10e1419469"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":52,"context_line":"                       \u0027ip_address\u0027: \u00271.1.1.1\u0027}]]"},{"line_number":53,"context_line":"        for fixed in fixed_ips:"},{"line_number":54,"context_line":"            msg \u003d attributes._validate_fixed_ips(fixed, None)"},{"line_number":55,"context_line":"            self.assertEquals(1, len(msg) !\u003d 0)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def test_nameservers(self):"},{"line_number":58,"context_line":"        ns_pools \u003d [[\u00271100.0.0.2\u0027],"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F5Rs%3D","line":55,"in_reply_to":"AAAALn%2F%2F5Vs%3D","updated":"2012-10-30 08:01:01.000000000","message":"Done","commit_id":"5dd6cf3209991e64a4be96f5fcb5ba10e1419469"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":60,"context_line":"                    None]"},{"line_number":61,"context_line":"        for ns in ns_pools:"},{"line_number":62,"context_line":"            msg \u003d attributes._validate_nameservers(ns, None)"},{"line_number":63,"context_line":"            self.assertEquals(1, len(msg) !\u003d 0)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def test_hostroutes(self):"},{"line_number":66,"context_line":"        hostroute_pools \u003d [[{\u0027destination\u0027: \u0027100.0.0.0/24\u0027}],"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F5Vw%3D","line":63,"updated":"2012-10-30 03:19:16.000000000","message":"Ditto","commit_id":"5dd6cf3209991e64a4be96f5fcb5ba10e1419469"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":60,"context_line":"                    None]"},{"line_number":61,"context_line":"        for ns in ns_pools:"},{"line_number":62,"context_line":"            msg \u003d attributes._validate_nameservers(ns, None)"},{"line_number":63,"context_line":"            self.assertEquals(1, len(msg) !\u003d 0)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def test_hostroutes(self):"},{"line_number":66,"context_line":"        hostroute_pools \u003d [[{\u0027destination\u0027: \u0027100.0.0.0/24\u0027}],"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F5Ro%3D","line":63,"in_reply_to":"AAAALn%2F%2F5Vw%3D","updated":"2012-10-30 08:01:01.000000000","message":"Done","commit_id":"5dd6cf3209991e64a4be96f5fcb5ba10e1419469"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":72,"context_line":"                           None]"},{"line_number":73,"context_line":"        for host_routes in hostroute_pools:"},{"line_number":74,"context_line":"            msg \u003d attributes._validate_hostroutes(host_routes, None)"},{"line_number":75,"context_line":"            self.assertEquals(1, len(msg) !\u003d 0)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def test_mac_addresses(self):"},{"line_number":78,"context_line":"        # Valid - 3 octets"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F5Vo%3D","line":75,"updated":"2012-10-30 03:19:16.000000000","message":"ditto","commit_id":"5dd6cf3209991e64a4be96f5fcb5ba10e1419469"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":72,"context_line":"                           None]"},{"line_number":73,"context_line":"        for host_routes in hostroute_pools:"},{"line_number":74,"context_line":"            msg \u003d attributes._validate_hostroutes(host_routes, None)"},{"line_number":75,"context_line":"            self.assertEquals(1, len(msg) !\u003d 0)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def test_mac_addresses(self):"},{"line_number":78,"context_line":"        # Valid - 3 octets"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F5Rk%3D","line":75,"in_reply_to":"AAAALn%2F%2F5Vo%3D","updated":"2012-10-30 08:01:01.000000000","message":"Done","commit_id":"5dd6cf3209991e64a4be96f5fcb5ba10e1419469"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":91,"context_line":"        base_mac \u003d \"01:16:3e:4f:00:00\""},{"line_number":92,"context_line":"        msg \u003d attributes._validate_regex(base_mac,"},{"line_number":93,"context_line":"                                         attributes.MAC_PATTERN)"},{"line_number":94,"context_line":"        self.assertEquals(1, len(msg) !\u003d 0)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        # Invalid - invalid format"},{"line_number":97,"context_line":"        base_mac \u003d \"a:16:3e:4f:00:00\""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F5Xg%3D","line":94,"updated":"2012-10-30 02:54:44.000000000","message":"While the evaluation of the args results in the correct logic, I don\u0027t think it\u0027s the clearest way to phrase it. Consider:\n\nself.assertIsNotNone(msg)\n\nNote: This also applies to the other 5 instances within this method.","commit_id":"5dd6cf3209991e64a4be96f5fcb5ba10e1419469"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":91,"context_line":"        base_mac \u003d \"01:16:3e:4f:00:00\""},{"line_number":92,"context_line":"        msg \u003d attributes._validate_regex(base_mac,"},{"line_number":93,"context_line":"                                         attributes.MAC_PATTERN)"},{"line_number":94,"context_line":"        self.assertEquals(1, len(msg) !\u003d 0)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        # Invalid - invalid format"},{"line_number":97,"context_line":"        base_mac \u003d \"a:16:3e:4f:00:00\""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALn%2F%2F5Rg%3D","line":94,"in_reply_to":"AAAALn%2F%2F5Xg%3D","updated":"2012-10-30 08:01:01.000000000","message":"Done","commit_id":"5dd6cf3209991e64a4be96f5fcb5ba10e1419469"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":49,"context_line":"            self.assertIsNotNone(msg)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def test_fixed_ips(self):"},{"line_number":52,"context_line":"        fixed_ips \u003d [[{\u0027subnet_id\u0027: \u002700000000-ffff-ffff-ffff-000000000000\u0027,"},{"line_number":53,"context_line":"                       \u0027ip_address\u0027: \u00271111.1.1.1\u0027}],"},{"line_number":54,"context_line":"                     [{\u0027subnet_id\u0027: \u0027invalid\u0027}],"},{"line_number":55,"context_line":"                     None,"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1WY%3D","line":52,"updated":"2012-11-02 15:29:35.000000000","message":"I\u0027d add ip_address without subnet_id to the list of tests to fail. Or is that supposed to work?","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":49,"context_line":"            self.assertIsNotNone(msg)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def test_fixed_ips(self):"},{"line_number":52,"context_line":"        fixed_ips \u003d [[{\u0027subnet_id\u0027: \u002700000000-ffff-ffff-ffff-000000000000\u0027,"},{"line_number":53,"context_line":"                       \u0027ip_address\u0027: \u00271111.1.1.1\u0027}],"},{"line_number":54,"context_line":"                     [{\u0027subnet_id\u0027: \u0027invalid\u0027}],"},{"line_number":55,"context_line":"                     None,"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1O4%3D","line":52,"in_reply_to":"AAAALn%2F%2F1Qg%3D","updated":"2012-11-02 17:03:08.000000000","message":"ok.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":49,"context_line":"            self.assertIsNotNone(msg)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def test_fixed_ips(self):"},{"line_number":52,"context_line":"        fixed_ips \u003d [[{\u0027subnet_id\u0027: \u002700000000-ffff-ffff-ffff-000000000000\u0027,"},{"line_number":53,"context_line":"                       \u0027ip_address\u0027: \u00271111.1.1.1\u0027}],"},{"line_number":54,"context_line":"                     [{\u0027subnet_id\u0027: \u0027invalid\u0027}],"},{"line_number":55,"context_line":"                     None,"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAALn%2F%2F1Qg%3D","line":52,"in_reply_to":"AAAALn%2F%2F1WY%3D","updated":"2012-11-02 16:27:40.000000000","message":"The code accepts and ip_address without subnet. At the moment this is valid input and checked if it is exists in one of the configured subnets on the network.","commit_id":"a1bf1fee827995b8b71f2011fc8b987c2eea3fe8"}],"quantum/tests/unit/test_db_plugin.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":1926,"context_line":"            res \u003d subnet_req.get_response(self.api)"},{"line_number":1927,"context_line":"            self.assertEquals(res.status_int, 403)"},{"line_number":1928,"context_line":""},{"line_number":1929,"context_line":"    def test_create_subnet_bad_inputs(self):"},{"line_number":1930,"context_line":"        with self.network() as network:"},{"line_number":1931,"context_line":"            # Check bad IP version"},{"line_number":1932,"context_line":"            data \u003d {\u0027subnet\u0027: {\u0027network_id\u0027: network[\u0027network\u0027][\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FJiQ%3D","line":1929,"updated":"2012-10-11 04:41:45.000000000","message":"Consider breaking this method into separate tests (6?)","commit_id":"f1325ca1410022c6db1fc6b32de06b8ff06f1aeb"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":1926,"context_line":"            res \u003d subnet_req.get_response(self.api)"},{"line_number":1927,"context_line":"            self.assertEquals(res.status_int, 403)"},{"line_number":1928,"context_line":""},{"line_number":1929,"context_line":"    def test_create_subnet_bad_inputs(self):"},{"line_number":1930,"context_line":"        with self.network() as network:"},{"line_number":1931,"context_line":"            # Check bad IP version"},{"line_number":1932,"context_line":"            data \u003d {\u0027subnet\u0027: {\u0027network_id\u0027: network[\u0027network\u0027][\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FJdI%3D","line":1929,"in_reply_to":"AAAALH%2F%2FJiQ%3D","updated":"2012-10-22 09:11:25.000000000","message":"Done","commit_id":"f1325ca1410022c6db1fc6b32de06b8ff06f1aeb"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"39b0dbd3ef60d166e98382d098f0d8cb5261d0c3","unresolved":false,"context_lines":[{"line_number":1946,"context_line":"            res \u003d subnet_req.get_response(self.api)"},{"line_number":1947,"context_line":"            self.assertEquals(res.status_int, 403)"},{"line_number":1948,"context_line":""},{"line_number":1949,"context_line":"    def test_create_subnet_bad_ip_version(self):"},{"line_number":1950,"context_line":"        with self.network() as network:"},{"line_number":1951,"context_line":"            # Check bad IP version"},{"line_number":1952,"context_line":"            data \u003d {\u0027subnet\u0027: {\u0027network_id\u0027: network[\u0027network\u0027][\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FGbU%3D","line":1949,"updated":"2012-10-19 16:11:32.000000000","message":"Same question with https://bugs.launchpad.net/quantum/+bug/1067959\nI notice we have /quantum/quantum/tests/unit/test_attributes.py for test attributes. Should we add attributes test to it? This is for test db plugin, although it works at here.","commit_id":"5111025d62d60d839caff11c80e20f1eade6b81e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":1946,"context_line":"            res \u003d subnet_req.get_response(self.api)"},{"line_number":1947,"context_line":"            self.assertEquals(res.status_int, 403)"},{"line_number":1948,"context_line":""},{"line_number":1949,"context_line":"    def test_create_subnet_bad_ip_version(self):"},{"line_number":1950,"context_line":"        with self.network() as network:"},{"line_number":1951,"context_line":"            # Check bad IP version"},{"line_number":1952,"context_line":"            data \u003d {\u0027subnet\u0027: {\u0027network_id\u0027: network[\u0027network\u0027][\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALn%2F%2F%2FAc%3D","line":1949,"in_reply_to":"AAAALH%2F%2FGbU%3D","updated":"2012-10-23 13:44:45.000000000","message":"hi, you are correct. i missed this and have added it.\ni also prefer to leave these tests","commit_id":"5111025d62d60d839caff11c80e20f1eade6b81e"}]}
