[2.1.4] Expecting object received tuple in get_default_dns_servers

Bug #1671048 reported by Krzysztof Szukiełojć
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Gavin Panella
Gavin Panella

Bug Description

_get_gateway_tuple in node.py:2827 returns tuple, but
get_default_dns_servers:2891 is expecting namedtuple/object here
which causes

2017-03-08 10:00:40 maasserver: [error] Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/views.py", line 177, in view_atomic_with_post_commit_savepoint
    return view_atomic(*args, **kwargs)
  File "/usr/lib/python3.5/contextlib.py", line 30, in inner
    return func(*args, **kwds)
  File "/usr/lib/python3/dist-packages/maasserver/api/support.py", line 59, in __call__
    response = upcall(request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/django/views/decorators/vary.py", line 21, in inner_func
    response = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/piston3/resource.py", line 190, in __call__
    result = self.error_handler(e, request, meth, em_format)
  File "/usr/lib/python3/dist-packages/piston3/resource.py", line 188, in __call__
    result = meth(request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/api/support.py", line 298, in dispatch
    return function(self, request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/api/machines.py", line 605, in get_curtin_config
    get_curtin_merged_config(machine), default_flow_style=False),
  File "/usr/lib/python3/dist-packages/maasserver/preseed.py", line 329, in get_curtin_merged_config
    yaml_config = get_curtin_yaml_config(node)
  File "/usr/lib/python3/dist-packages/maasserver/preseed.py", line 308, in get_curtin_yaml_config
    network_config = compose_curtin_network_config(node)
  File "/usr/lib/python3/dist-packages/maasserver/preseed_network.py", line 425, in compose_curtin_network_config
    return [generator.generate()]
  File "/usr/lib/python3/dist-packages/maasserver/preseed_network.py", line 64, in generate
    ipv4=self.addr_family_present[4], ipv6=self.addr_family_present[6])
  File "/usr/lib/python3/dist-packages/maasserver/models/node.py", line 2891, in get_default_dns_servers
    subnet = Subnet.objects.get(id=gateways.ipv4.subnet_id)
AttributeError: 'tuple' object has no attribute 'subnet_id'

Related branches

Changed in maas:
importance: Undecided → Critical
milestone: none → 2.2.0
status: New → Triaged
Gavin Panella (allenap)
summary: - [2.1.4]Expecting object recived tuple in get_default_dns_servers
+ [2.1.4] Expecting object received tuple in get_default_dns_servers
Revision history for this message
Blake Rouse (blake-rouse) wrote :

This will cause a deploying node not to get an interface configuration. Which means it will have no /etc/network/interfaces, so the node will not be able to contact MAAS to finish deployment.

Gavin Panella (allenap)
Changed in maas:
assignee: nobody → Gavin Panella (allenap)
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Revision history for this message
Larry Michel (lmic) wrote :

@Andres, I was able to test this and it works.

Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers