2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-27 03:19:56 +00:00

Attempt to fixup ownership, if applicable on the output

This commit is contained in:
Jarrod Johnson 2021-06-14 15:17:54 -04:00
parent e678ca24f9
commit ac2474f43e

View File

@ -5,6 +5,7 @@ import ctypes.util
import glob
import optparse
import os
import pwd
import re
import shutil
import struct
@ -336,9 +337,6 @@ def pack_image(opts, args):
os.symlink(
'/var/lib/confluent/public/site/initramfs.cpio',
os.path.join(outdir, 'boot/initramfs/site.cpio'))
#os.symlink(
# '/var/lib/confluent/public/site/initramfs.cpio',
# os.path.join(outdir, 'boot/initramfs/site.cpio'))
shutil.copyfile(kvermap[mostrecent], os.path.join(outdir, 'boot/kernel'))
shutil.copyfile(initrdname, os.path.join(outdir, 'boot/initramfs/distribution'))
shutil.copyfile(os.path.join(args[0], 'boot/efi/EFI/BOOT/BOOTX64.EFI'), os.path.join(outdir, 'boot/efi/boot/BOOTX64.EFI'))
@ -366,7 +364,11 @@ def pack_image(opts, args):
'/opt/confluent/lib/osdeploy/{}-diskless/initramfs/addons.cpio'.format(
oshandler.oscategory),
os.path.join(outdir, 'boot/initramfs/addons.cpio'))
try:
pwd.getpwnam('confluent')
subprocess.check_call(['chown', '-R', 'confluent', outdir])
except KeyError:
pass