Auto-detect partition types for mounting more images
Auto-detect partition types for mounting more images

This change replaces the behaviour which makes assumptions about the
partition layout based simply on how many partitions there are.

Instead, attributes of the block device are used to infer whether the
partition is a boot, EFI, or root device.

This change is required to mount the RHEL-9 image, which is a
whole-disk image that has boot, EFI, and root partitions.

Images known to correctly mount with this change include:
overcloud-full.qcow2
overcloud-hardened-uefi-full.qcow2
CentOS-Stream-GenericCloud-8-20210603.0.x86_64.qcow2
CentOS-Stream-GenericCloud-9-20220127.0.x86_64.qcow2
rhel-guest-image-9.0-20220125.3.x86_64.qcow2
openSUSE-Leap-15.3.x86_64-NoCloud.qcow2
bionic-server-cloudimg-amd64.img
bionic-server-cloudimg-amd64.squashfs
debian-10-openstack-amd64.qcow2

A similar approach may be attempted to add rhel-9 support to
diskimage-builder extract-image.

This change also fixes an incorrect check path in the remove_device
function.

Change-Id: I4397a660e874ff351f5da697ddc504e0f2c8cf5a

openstack/tripleo-common,openstack/tripleo-common