Removed the input validation check
This commit is contained in:
@ -465,8 +465,8 @@ def edit_ip_address(ipv4: str, ipv6: str):
|
||||
:raises InvalidInputError: If neither ipv4 nor ipv6 is provided.
|
||||
'''
|
||||
|
||||
if not ipv4 and not ipv6:
|
||||
raise InvalidInputError('Error: --edit requires at least one of --ipv4 or --ipv6.')
|
||||
# if not ipv4 and not ipv6:
|
||||
# raise InvalidInputError('Error: --edit requires at least one of --ipv4 or --ipv6.')
|
||||
if ipv4:
|
||||
run_cmd(['python3', Command.IP_ADD.value, 'edit', '-4', ipv4])
|
||||
if ipv6:
|
||||
|
||||
@ -57,9 +57,8 @@ async def edit_ip_api(body: EditInputBody):
|
||||
body: An instance of EditInputBody containing the new IPv4 and/or IPv6 addresses.
|
||||
"""
|
||||
try:
|
||||
if not body.ipv4 and not body.ipv6:
|
||||
raise HTTPException(status_code=400, detail='Error: You must specify either ipv4 or ipv6')
|
||||
|
||||
# if not body.ipv4 and not body.ipv6:
|
||||
# raise HTTPException(status_code=400, detail='Error: You must specify either ipv4 or ipv6')
|
||||
cli_api.edit_ip_address(str(body.ipv4), str(body.ipv6))
|
||||
return DetailResponse(detail='IP address edited successfully.')
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user