diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-11-09 10:08:10 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-11-09 10:08:10 +0800 |
commit | 2ca52d1ebd934035bfdc99a9c777b666ee5cb5e4 (patch) | |
tree | 0b7e98292157afbbdb4c3208db97d64a3756d57d /fg21sim | |
parent | 6ed92c4c5f85bc6975497af868210af072a18168 (diff) | |
download | fg21sim-2ca52d1ebd934035bfdc99a9c777b666ee5cb5e4.tar.bz2 |
webui: utils.py: Improve the docstring of "ip_in_network()"
Diffstat (limited to 'fg21sim')
-rw-r--r-- | fg21sim/webui/utils.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fg21sim/webui/utils.py b/fg21sim/webui/utils.py index b3b013a..bf62525 100644 --- a/fg21sim/webui/utils.py +++ b/fg21sim/webui/utils.py @@ -92,7 +92,13 @@ def ip_in_network(ip, network): ip : `~ipaddress.IPv4Address`, str An `~ipaddress.IPv4Address` instance or a string of the IPv4 address network : `~ipaddress.IPv4Network`, str - An `~ipaddress.IPv4Network` instance or a string of the IPv4 network + An `~ipaddress.IPv4Network` instance or a string of the IPv4 network, + which is generally written in the CIDR format. + + Raises + ------ + ValueError : + Input IP or network is invalid. """ if not isinstance(ip, ipaddress.IPv4Address): ip = ipaddress.IPv4Address(ip) |