create a subnet arg validator

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
allow passing public/private networks to new

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
add some tests for the dumb subnet validator

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
add 1600 tests

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
create a utility to check for ips in subnet

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
optionally use the public address when getting the ip

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
log the fact that we were (or were not) able to match an IP to a subnet

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
fixed some patching on get_nonlocal_ip for the new keyword

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
feature creep: fix eating up errors before logging is set

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
'new' will now validate subnets and remote IPs

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
a gigantic amount of code for remote IP validation

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
remove docs referencing 'new' from index

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
add new.rst to the contents toc tree

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
create a new.rst file for the new subcommand

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
add example to docstring for ip_addresses

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
prefer the public network IP if --public-network is used

which will connect to the remote node, fetch all the IPs and
pick the one that matches the subnet

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
This is absolutely TERRIBLE

we have to now patch like mad people all these methods. These
old tests should burn in the fire of the parent suns of the galaxy.

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
host validation ip should be done per subnet, not per ip

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
add tests to ensure we do the right thing with per subnet validation

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
move a generic test utility to its own module

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>

Closes #233