2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-21 17:11:58 +00:00

Numerous fixes

Normalize cloning by wipefs prior to image2disk

Have imgutil filter out zram mounts.

Fix syncfiles error handling.
This commit is contained in:
Jarrod Johnson 2024-03-15 13:03:46 -04:00
parent bd2288ccb7
commit 60fe306890
3 changed files with 6 additions and 2 deletions

View File

@ -30,6 +30,7 @@ if [ ! -f /sysroot/tmp/installdisk ]; then
done
fi
lvm vgchange -a n
/sysroot/usr/sbin/wipefs -a /dev/$(cat /sysroot/tmp/installdisk)
udevadm control -e
if [ -f /sysroot/etc/lvm/devices/system.devices ]; then
rm /sysroot/etc/lvm/devices/system.devices

View File

@ -193,6 +193,7 @@ def sync_list_to_node(sl, node, suffixes, peerip=None):
targip = node
if peerip:
targip = peerip
#BOOO, need stderr!!!
output = util.run(
['rsync', '-rvLD', targdir + '/', 'root@[{}]:/'.format(targip)])[0]
except Exception as e:
@ -212,7 +213,7 @@ def sync_list_to_node(sl, node, suffixes, peerip=None):
unreadablefiles.append(filename.replace(targdir, ''))
if unreadablefiles:
raise Exception("Syncing failed due to unreadable files: " + ','.join(unreadablefiles))
elif b'Permission denied, please try again.' in e.stderr:
elif hasattr(e, 'stderr') and e.stderr and b'Permission denied, please try again.' in e.stderr:
raise Exception('Syncing failed due to authentication error, is the confluent automation key not set up (osdeploy initialize -a) or is there some process replacing authorized_keys on the host?')
else:
raise
@ -231,7 +232,7 @@ def stage_ent(currmap, ent, targdir, appendexist=False):
everyfent = []
allfents = ent.split()
for tmpent in allfents:
fents = glob.glob(tmpent)
fents = glob.glob(tmpent) # TODO: recursive globbing?
if not fents:
raise Exception('No matching files for "{}"'.format(tmpent))
everyfent.extend(fents)

View File

@ -83,6 +83,8 @@ def get_partition_info():
dev, mount, fs, flags = entry.split()[:4]
if mount not in capmounts:
continue
if '/dev/zram' in dev:
continue
fsinfo = os.statvfs(mount)
partinfo = {
'mount': mount,