I've updated the find_device_for_file() function in /usr/bin/hibinit-agent to:
def find_device_for_file(filename): # Find the mount point for the swap file ('df -P /swap') df_out = check_output(['df', '-P', filename]).decode('ascii') dev_str = df_out.split("\n")[1].split()[0] lsblk_out = check_output(['lsblk', '-dno', 'PARTUUID', dev_str]).decode('ascii') uuid_str = lsblk_out.strip() return "PARTUUID=%s" % (uuid_str)
I've tested this on xenial and bionic. With xenial, I would see 2-3% failures on certain instance types due to this issue. Now I see none.
I've updated the find_device_ for_file( ) function in /usr/bin/ hibinit- agent to:
def find_device_ for_file( filename) : ).decode( 'ascii' ) split(" \n")[1] .split( )[0] ['lsblk' , '-dno', 'PARTUUID', dev_str] ).decode( 'ascii' )
# Find the mount point for the swap file ('df -P /swap')
df_out = check_output(['df', '-P', filename]
dev_str = df_out.
lsblk_out = check_output(
uuid_str = lsblk_out.strip()
return "PARTUUID=%s" % (uuid_str)
I've tested this on xenial and bionic. With xenial, I would see 2-3% failures on certain instance types due to this issue. Now I see none.