Merge lp://qastaging/~jtv/maas/hide-cluster-default-disable-ipv4-if-no-ipv6 into lp://qastaging/~maas-committers/maas/trunk

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: no longer in the source branch.
Merged at revision: 3249
Proposed branch: lp://qastaging/~jtv/maas/hide-cluster-default-disable-ipv4-if-no-ipv6
Merge into: lp://qastaging/~maas-committers/maas/trunk
Prerequisite: lp://qastaging/~jtv/maas/bug-1379816
Diff against target: 70 lines (+45/-0)
2 files modified
src/maasserver/forms.py (+10/-0)
src/maasserver/tests/test_forms_nodegroup.py (+35/-0)
To merge this branch: bzr merge lp://qastaging/~jtv/maas/hide-cluster-default-disable-ipv4-if-no-ipv6
Reviewer Review Type Date Requested Status
Raphaël Badin (community) Approve
Review via email: mp+238254@code.qastaging.launchpad.net

Commit message

Hide the cluster edit form's “disable IPv4 by default” button if the cluster has no managed IPv6 interfaces.

Description of the change

Depends on https://code.launchpad.net/~jtv/maas/bug-1379816/+merge/238001 (which is blocked on this change).

The trick is the same one we also used on the Node form's disable_ipv4 field. If the field should not be displayed, we configure it with an empty label and its widget type set to HiddenInput. That way the field still works in the API, but the UI won't show it.

What happens if you leave this field in the “disable IPv4” setting but disable IPv6 on your cluster? Any new nodes will still be created with the setting enabled by default. But when you deploy a node with IPv4 disabled on a cluster that does not manage any IPv6 subnets, the nodes will simply ignore the setting and come up with IPv4 anyway. (This is currently done in the Ubuntu OperatingSystem implementation, but it should eventually be in generic code.)

Jeroen

To post a comment you must log in.
Revision history for this message
Raphaël Badin (rvb) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.