)]}'
{"python/drydock_provisioner/orchestrator/validations/cidr_validity.py":[{"author":{"_account_id":26449,"name":"Scott Hussey","email":"sthussey@att.com","username":"sh8121"},"change_message_id":"ecd4c46ea10ccc5730b9c42b626408f95dd82a4f","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            for net in network_list:"},{"line_number":38,"context_line":"                cidr_ip \u003d IPNetwork(net.cidr).ip"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"                # Verify that the CIDR IP ends in \u0027.0\u0027 as expected by MAAS"},{"line_number":41,"context_line":"                if not str(cidr_ip).endswith(\".0\"):"},{"line_number":42,"context_line":"                    msg \u003d \u0027The provided CIDR IP %s is not what MAAS expects\u0027 % cidr_ip"},{"line_number":43,"context_line":"                    self.report_error("}],"source_content_type":"text/x-python","patch_set":7,"id":"5fc1f717_0af3af0a","line":40,"range":{"start_line":40,"start_character":15,"end_line":40,"end_character":74},"updated":"2019-04-09 20:18:18.000000000","message":"I think this is a bit off. Rather then ensuring a CIDR ends in .0, we should just validate the equivalency of the CIDR and the subnet address of the CIDR. So if you give MAAS something like 192.168.1.130/25, it creates a network of 192.168.1.128/25 since 192.168.1.128 is the subnet address. However Drydock continues to consider the CIDR to be 192.168.1.130. So we should validate that all CIDRs use the actual subnet address of the CIDR so that MAAS and Drydock are in agreement of the CIDR string.","commit_id":"26daab136a427236ca3d8d642780788f004c2ac3"},{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"0111db0fe08bd4acc773fc085bc831528b684542","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            for net in network_list:"},{"line_number":38,"context_line":"                cidr_ip \u003d IPNetwork(net.cidr).ip"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"                # Verify that the CIDR IP ends in \u0027.0\u0027 as expected by MAAS"},{"line_number":41,"context_line":"                if not str(cidr_ip).endswith(\".0\"):"},{"line_number":42,"context_line":"                    msg \u003d \u0027The provided CIDR IP %s is not what MAAS expects\u0027 % cidr_ip"},{"line_number":43,"context_line":"                    self.report_error("}],"source_content_type":"text/x-python","patch_set":7,"id":"3fce034c_1eb16b90","line":40,"range":{"start_line":40,"start_character":15,"end_line":40,"end_character":74},"in_reply_to":"5fc1f717_0af3af0a","updated":"2019-04-11 14:58:23.000000000","message":"Hey Scott, thanks for the review. I think this can be accomplished with the following:\n\nipaddress.ip_network(cidr_ip) \n\nThis will check if the CIDR has host bits set or not. If there is no host bits, then the CIDR is using the subnet address.","commit_id":"26daab136a427236ca3d8d642780788f004c2ac3"},{"author":{"_account_id":28025,"name":"Randeep Jalli","email":"rj2083@att.com","username":"randeep.jalli"},"change_message_id":"cd894dcc8e79cd207f6a2308799c2053682e85f5","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            for net in network_list:"},{"line_number":38,"context_line":"                cidr_ip \u003d IPNetwork(net.cidr).ip"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"                # Verify that the CIDR IP ends in \u0027.0\u0027 as expected by MAAS"},{"line_number":41,"context_line":"                if not str(cidr_ip).endswith(\".0\"):"},{"line_number":42,"context_line":"                    msg \u003d \u0027The provided CIDR IP %s is not what MAAS expects\u0027 % cidr_ip"},{"line_number":43,"context_line":"                    self.report_error("}],"source_content_type":"text/x-python","patch_set":7,"id":"5fc1f717_caccc762","line":40,"range":{"start_line":40,"start_character":15,"end_line":40,"end_character":74},"in_reply_to":"5fc1f717_0af3af0a","updated":"2019-04-09 20:38:42.000000000","message":"so you wanna make sure that the CIDR you\u0027re passed doesn\u0027t have any host bits set correct? It\u0027s just the network address/subnetmask?","commit_id":"26daab136a427236ca3d8d642780788f004c2ac3"},{"author":{"_account_id":26449,"name":"Scott Hussey","email":"sthussey@att.com","username":"sh8121"},"change_message_id":"e582104cb99644864811e18901bbf4c95b45a3e9","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                    ipaddress.ip_network(net.cidr)"},{"line_number":40,"context_line":"                except ValueError as e:"},{"line_number":41,"context_line":"                    if str(e) \u003d\u003d (net.cidr + \" has host bits set\"):"},{"line_number":42,"context_line":"                        msg \u003d \u0027The provided CIDR %s is not what MAAS expects\u0027 % net.cidr"},{"line_number":43,"context_line":"                        valid_cidr \u003d ipaddress.ip_network(net.cidr, strict\u003dFalse)"},{"line_number":44,"context_line":"                        self.report_error("},{"line_number":45,"context_line":"                                    msg, [net.doc_ref],"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fce034c_026f8192","line":42,"updated":"2019-04-16 14:18:37.000000000","message":"Could we be more clear what check is failing? I would just state that the CIDR has host bits set.","commit_id":"3bda271547a28361d75fd9b5bd0dac4ac6512d36"},{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"17a0499903448a56b890ce2b6b2d3ca48bdadefa","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                    ipaddress.ip_network(net.cidr)"},{"line_number":40,"context_line":"                except ValueError as e:"},{"line_number":41,"context_line":"                    if str(e) \u003d\u003d (net.cidr + \" has host bits set\"):"},{"line_number":42,"context_line":"                        msg \u003d \u0027The provided CIDR %s is not what MAAS expects\u0027 % net.cidr"},{"line_number":43,"context_line":"                        valid_cidr \u003d ipaddress.ip_network(net.cidr, strict\u003dFalse)"},{"line_number":44,"context_line":"                        self.report_error("},{"line_number":45,"context_line":"                                    msg, [net.doc_ref],"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fce034c_3251a10f","line":42,"in_reply_to":"3fce034c_026f8192","updated":"2019-04-16 21:34:35.000000000","message":"Done","commit_id":"3bda271547a28361d75fd9b5bd0dac4ac6512d36"}]}
