← Back to team overview

sts-sponsors team mailing list archive

[Merge] ~troyanov/maas:refactor-remove-extra-call into maas:master

 

Anton Troyanov has proposed merging ~troyanov/maas:refactor-remove-extra-call into maas:master.

Commit message:
refactor: remove extra func call

Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~troyanov/maas/+git/maas/+merge/443671
-- 
Your team MAAS Committers is subscribed to branch maas:master.
diff --git a/src/maasserver/models/node.py b/src/maasserver/models/node.py
index d1f3165..e17cec0 100644
--- a/src/maasserver/models/node.py
+++ b/src/maasserver/models/node.py
@@ -5549,7 +5549,8 @@ class Node(CleanSave, TimestampedModel):
         # not.  To keep this unit-testable, only check for address family
         # compatibility when there is a rack controller.  If we don't have a
         # rack controller, the deploy will be rejected in any case.
-        if self.get_boot_primary_rack_controller() is not None:
+        boot_primary_rack_controller = self.get_boot_primary_rack_controller()
+        if boot_primary_rack_controller is not None:
             subnets = Subnet.objects.filter(
                 staticipaddress__interface__node_config_id=self.current_config_id,
                 staticipaddress__alloc_type__in=[
@@ -5564,7 +5565,7 @@ class Node(CleanSave, TimestampedModel):
             rack_address_families = {
                 4 if addr.is_ipv4_mapped() else addr.version
                 for addr in get_maas_facing_server_addresses(
-                    self.get_boot_primary_rack_controller()
+                    boot_primary_rack_controller
                 )
             }
             if my_address_families & rack_address_families == set():

Follow ups