1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #7519: Return a 409 status for unfulfillable available prefix/IP requests

This commit is contained in:
jeremystretch
2021-12-10 15:11:45 -05:00
parent 3a05eda63a
commit 7c14c0812b
2 changed files with 3 additions and 2 deletions

View File

@@ -208,7 +208,7 @@ class AvailablePrefixesView(ObjectValidationMixin, APIView):
{
"detail": "Insufficient space is available to accommodate the requested prefix size(s)"
},
status=status.HTTP_204_NO_CONTENT
status=status.HTTP_409_CONFLICT
)
# Remove the allocated prefix from the list of available prefixes
@@ -288,7 +288,7 @@ class AvailableIPAddressesView(ObjectValidationMixin, APIView):
"detail": f"An insufficient number of IP addresses are available within {parent} "
f"({len(requested_ips)} requested, {len(available_ips)} available)"
},
status=status.HTTP_204_NO_CONTENT
status=status.HTTP_409_CONFLICT
)
# Assign addresses from the list of available IPs and copy VRF assignment from the parent