2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-04-30 20:37:47 +00:00

Fix imgutil async call

This commit is contained in:
Jarrod Johnson
2026-04-30 10:26:54 -04:00
parent 7f604e3e35
commit d03e689660

View File

@@ -1,4 +1,5 @@
#!/usr/bin/python3
import asyncio
import configparser
import ctypes
import ctypes.util
@@ -197,7 +198,7 @@ def build_el_boot_tree(targpath):
gather_bootloader(targpath)
def capture_remote(args):
async def capture_remote(args):
targ = args.node
outdir = args.profilename
os.umask(0o022)
@@ -267,7 +268,7 @@ def capture_remote(args):
indir = '{}/profiles/default'.format(confdir)
if os.path.exists(indir):
copy_tree(indir, outdir)
hmap = osimage.get_hashes(outdir)
hmap = await osimage.get_hashes(outdir)
with open('{0}/manifest.yaml'.format(outdir), 'w') as yout:
yout.write('# This manifest enables rebase to know original source of profile data and if any customizations have been done\n')
manifestdata = {'distdir': indir, 'disthashes': hmap}
@@ -944,13 +945,13 @@ def main():
if args.subcommand == 'build':
build_root(args)
elif args.subcommand == 'capture':
capture_remote(args)
asyncio.run(capture_remote(args))
elif args.subcommand == 'unpack':
unpack_image(args)
elif args.subcommand == 'exec':
exec_root(args)
elif args.subcommand == 'pack':
pack_image(args)
asyncio.run(pack_image(args))
else:
parser.print_usage()
@@ -1366,7 +1367,7 @@ def recursecp(source, targ):
shutil.copy2(source, targ)
def pack_image(args):
async def pack_image(args):
outdir = args.profilename
if '/' in outdir:
raise Exception('Full path not supported, supply only the profile name\n')
@@ -1465,7 +1466,7 @@ def pack_image(args):
indir = '{}/profiles/default'.format(confdir)
if os.path.exists(indir):
copy_tree(indir, outdir)
hmap = osimage.get_hashes(outdir)
hmap = await osimage.get_hashes(outdir)
with open('{0}/manifest.yaml'.format(outdir), 'w') as yout:
yout.write('# This manifest enables rebase to know original source of profile data and if any customizations have been done\n')
manifestdata = {'distdir': indir, 'disthashes': hmap}