From af9676ee6f91f903d63c240fc12241d9babdf393 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 27 Jul 2021 08:36:48 -0400 Subject: [PATCH] Improve appearance of imgutil capture Provide more feedback with less worrisome normal output. --- imgutil/imgutil | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/imgutil/imgutil b/imgutil/imgutil index 6f673109..03b119a1 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -161,23 +161,23 @@ def capture_remote(opts, args): if finfo['oscategory'] != 'el8': raise Exception('Not yet supported for capture: ' + repr(finfo)) oscat = finfo['oscategory'] - subprocess.check_call(['ssh', '-t', targ, 'python3', '/run/imgutil/capenv/imgutil', 'capturelocal']) + subprocess.check_call(['ssh', '-o', 'LogLevel=QUIET', '-t', targ, 'python3', '/run/imgutil/capenv/imgutil', 'capturelocal']) utillib = __file__.replace('bin/imgutil', 'lib/imgutil') utillib = os.path.join(utillib, '{}/dracut/'.format(oscat)) subprocess.check_call(['rsync', '-a', utillib, '{0}:/usr/lib/dracut/modules.d/97confluent'.format(targ)]) - subprocess.check_call(['ssh', '-t', targ, 'python3', '/run/imgutil/capenv/imgutil', 'capturelocalboot']) - sys.stdout.write('Transferring image...') + sys.stdout.write('Generating deployment initramfs...') sys.stdout.flush() - subprocess.check_call(['rsync', '-a', '{0}:/run/imgutil/capout/'.format(targ), outdir]) + subprocess.check_call(['ssh', '-o', 'LogLevel=QUIET', '-t', targ, 'python3', '/run/imgutil/capenv/imgutil', 'capturelocalboot']) + print('Done\nTransferring image...') + sys.stdout.flush() + subprocess.check_call(['rsync', '-a', '--info=progress2', '{0}:/run/imgutil/capout/'.format(targ), outdir]) oum = os.umask(0o077) mkdirp(os.path.join(privdir, 'pending')) subprocess.check_call(['rsync', '-a', '{0}:/run/imgutil/private.key'.format(targ), '{}/pending/rootimg.key'.format(privdir)]) os.umask(oum) subprocess.check_call(['chown', '-R', 'confluent', privdir]) subprocess.check_call(['chmod', 'og-rwx', '-R', privdir]) - sys.stdout.write('Done\n') - sys.stdout.flush() - subprocess.check_call(['ssh', '-t', targ, 'python3', '/run/imgutil/capenv/imgutil', 'capturelocalcleanup']) + subprocess.check_call(['ssh', '-o', 'LogLevel=QUIET', '-t', targ, 'python3', '/run/imgutil/capenv/imgutil', 'capturelocalcleanup']) profname = os.path.basename(outdir) os.symlink('/var/lib/confluent/public/site/initramfs.cpio', os.path.join(outdir, 'boot/initramfs/site.cpio')) @@ -192,6 +192,8 @@ def capture_remote(opts, args): profileout.write('kernelargs: quiet installtodisk # remove installtodisk to boot stateless') subprocess.check_call(['chmod', 'o+r,go-w,a-t', '-R', outdir]) subprocess.check_call(['chown', '-R', 'confluent', outdir]) + sys.stdout.write('Updating boot image... ') + sys.stdout.flush() subprocess.check_call(['osdeploy', 'updateboot', profname])