'Get a UUID from the host operating system
Get a UUID for the host operating system. Modern Linux
distros based on systemd provide a /etc/machine-id
file containing a UUID. This is also provided inside
systemd based containers and can be provided by other
init systems too, since it is just a plain text file.'

def _get_host_sysinfo_serial_os(self):

    if (not os.path.exists('/etc/machine-id')):
        msg = _('Unable    to    get    host    UUID:    /etc/machine-id    does    not    exist')
        raise exception.InternalError(msg)
    with open('/etc/machine-id') as f:
        lines = f.read().split()
        if (not lines):
            msg = _('Unable    to    get    host    UUID:    /etc/machine-id    is    empty')
            raise exception.InternalError(msg)
        return str(uuid.UUID(lines[0]))
