install-method-check.sh can fail if MAAS is specified by IP address

Bug #1978355 reported by Rod Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
checkbox (Ubuntu)
In Progress
High
Rod Smith

Bug Description

The install-method-check.sh script runs a number of checks to identify the Ubuntu installation source. Among these is parsing the /var/lib/cloud/instance/datasource file, which normally looks something like this on a MAAS-deployed system:

DataSourceMAAS: DataSourceMAAS [http://10-193-36-0--23.maas-internal:5248/MAAS/metadata/]

Note that the MAAS server is identified by a rather awkward hostname (10-193-36-0--23.maas-internal); however, an IP address seems to sometimes be used instead:

DataSourceMAAS: DataSourceMAAS [http://10.193.37.117:5248/MAAS/metadata/]

When this happens, a subsequent check in verify_maas_ip() fails. This function uses the "host" command to convert the hostname into an IP address; but when it's already an IP address, the result is a failure of the test:

$ /usr/lib/plainbox-provider-checkbox/bin/install-method-check.sh
Installation data source is http://10.193.37.117:5248/MAAS/metadata/
ERROR: Unable to determine MAAS server's IP address
MAAS version is 1:2.9.2-9164-g.ac176b5c4-0ubuntu1~20.04.1
FAIL: System appears to have not been installed by MANIACS-compliant MAAS.

The verify_maas_ip() function should be made more robust against this condition.

Tags: servcert-392

Related branches

Rod Smith (rodsmith)
Changed in checkbox (Ubuntu):
assignee: nobody → Rod Smith (rodsmith)
importance: Undecided → High
Jeff Lane  (bladernr)
tags: added: servcert-392
Changed in checkbox (Ubuntu):
status: New → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.