Allow a(aaa)_add
with IP from non-existent network
#367
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the ability for the commands
a_add
andaaaa_add
to add an IP from a network that cannot be found with-force
. Previously, trying to add an IP from a network that could not be found raised a 404 error, which is not something we intended. This PR fixes that by usingok404=True
inNetwork.get_by_ip()
.All other calls to
Network.get_by_ip
expect it to returnNone
when the network cannot be found:mreg-cli/mreg_cli/commands/host_submodules/core.py
Lines 138 to 150 in c2df782
mreg-cli/mreg_cli/commands/host_submodules/core.py
Lines 156 to 163 in c2df782
mreg-cli/mreg_cli/commands/host_submodules/rr.py
Lines 540 to 542 in c2df782
This PR now ensures the 404 error is handled when the network does, in fact, not exist.