2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-01-11 10:32:31 +00:00

Fix imgutil with el8 diskless

This commit is contained in:
Jarrod Johnson
2025-05-06 08:39:53 -04:00
parent d0ae7b46ae
commit febccf4d5e

View File

@@ -752,10 +752,13 @@ class ElHandler(OsHandler):
subprocess.check_call(['yum'] + self.yumargs)
else:
subprocess.check_call(['yum', '-y'] + self.yumargs)
with open(os.path.join(self.targpath, 'etc/selinux/config'), 'r') as seconfigin:
seconfig = seconfigin.read().replace('SELINUX=enforcing', 'SELINUX=disabled')
with open(os.path.join(self.targpath, 'etc/selinux/config'), 'w') as seconfigout:
seconfigout.write(seconfig)
try:
with open(os.path.join(self.targpath, 'etc/selinux/config'), 'r') as seconfigin:
seconfig = seconfigin.read().replace('SELINUX=enforcing', 'SELINUX=disabled')
with open(os.path.join(self.targpath, 'etc/selinux/config'), 'w') as seconfigout:
seconfigout.write(seconfig)
except Exception: # this might not exist in all images
pass
with open('/proc/mounts') as mountinfo:
for line in mountinfo.readlines():
if line.startswith('selinuxfs '):