-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPAddress default namespace #4883
IPAddress default namespace #4883
Conversation
Without this fix, I was not able to create cc.: @whitej6 |
Are you trying to create an IPAddress without specifying either a |
Seems like expected behavior is to raise an exception However, this exception is not raised when using Probably not necessary to do anything with that, closing this PR. |
Reopening this as it's been pointed out that |
An IPAddress can't be created without a valid parent. This would be similar to setting a default form value on a required ForeignKey field and I don't think we do that anywhere else? |
We do this already on namespace = models.ForeignKey(
to="ipam.Namespace",
on_delete=models.PROTECT,
related_name="prefixes",
default=get_default_namespace_pk, <----------<<
) namespace = models.ForeignKey(
"ipam.Namespace",
on_delete=models.PROTECT,
related_name="vrfs",
default=get_default_namespace_pk, <---------<<
) It's also a usability issue for Jobs and Apps that are written for a single-namespace environment, having to either explicitly find the parent Prefix before creating the IP or else having to explicitly call |
Makes sense. We'll need to do a |
Closes: NaN
What's Changed
IPAddress
, when no namespace is provided.