Description:
When QUADS provisions a host via Foreman, prepare_host_provisioning fetches the partition tables associated with the target OS and blindly picks [0] -- Foreman's API returns items in alphabetical order. There is no way for the user to specify which ptable to use, no logging of which ptable was selected, and no validation that it's appropriate for the host.
Additionally, several bugs exist in the current flow:
- Empty ptable/medium lists cause an unhandled IndexError (foreman.py:423,426)
- self.logger in the exception handler should be logger, masking real errors (foreman.py:446)
- put_parameters_by_name silently skips setting the ptable if the name isn't found in the global /ptables endpoint (foreman.py:193)
- No log messages around ptable selection or failure
Description:
When QUADS provisions a host via Foreman, prepare_host_provisioning fetches the partition tables associated with the target OS and blindly picks [0] -- Foreman's API returns items in alphabetical order. There is no way for the user to specify which ptable to use, no logging of which ptable was selected, and no validation that it's appropriate for the host.
Additionally, several bugs exist in the current flow: