Code review comment for ~xnox/cloud-init:cidr

Revision history for this message
Ryan Harper (raharper) wrote :

In both cases, use of mask2cidr when not a dotted quad will return the original string sent, but that will end up embedded strings instead of integers:

>>> network_state.mask2cidr('24')
'24'
>>> network_state.mask2cidr('255.255.255.0')
24

I think we either need to modify mask2cidr to do something else (convert to integer) so it it's consistent across input invocations, or if we don't change mask2cidr, then the callers need to handle all of the following

address = 192.168.1.2/24 , netmask: None
address = 192.168.1.2/255.255.255.0 , netmask: None
address = 192.168.1.2 , netmask: 24
address = 192.168.1.2 , netmask: 255.255.255.0

https://code.launchpad.net/~raharper/curtin/trunk.vmtest-reuse-output/+merge/318150

review: Needs Fixing

« Back to merge proposal