mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Use raise from in modules (#11097)
* Use raise from. * Add changelog fragment. * Add comment.
This commit is contained in:
@@ -212,8 +212,8 @@ def parse_subnet_cidr(cidr):
|
||||
addr, prefixlen = cidr.split("/")
|
||||
try:
|
||||
prefixlen = int(prefixlen)
|
||||
except ValueError:
|
||||
raise Exception(f"Wrong prefix length in CIDR expression {cidr}")
|
||||
except ValueError as e:
|
||||
raise Exception(f"Wrong prefix length in CIDR expression {cidr}") from e
|
||||
return addr, prefixlen
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user